
These are the decoration greeting script that shows information and users who are currently logged in decorated ascii arts and colors while ssh into mobile server.
24 lines
706 B
Bash
24 lines
706 B
Bash
#!/bin/bash
|
|
|
|
# Source the print_box function
|
|
source ~/.custmScrpt/print_box.sh
|
|
|
|
# Array of log file paths or log variables
|
|
log_files=(
|
|
"$HOME/.cronlog/rvp_navidrome.txt"
|
|
"$HOME/.cronlog/rvp_http.txt"
|
|
# Add more log file paths or variables as needed
|
|
)
|
|
|
|
# Loop through each log file or variable
|
|
for log_file in "${log_files[@]}"; do
|
|
# Check if the log file exists
|
|
if [ ! -f "$log_file" ]; then
|
|
echo "Error: Log file $log_file does not exist."
|
|
continue
|
|
fi
|
|
|
|
# Use grep to filter the log file and pass the output to print_box
|
|
echo "$(basename $log_file):" && grep -m 1 -oE 'https?://[^/"]+' "$log_file" | sed -e 's/^/│ /' -e 's/$/ │/' | print_box
|
|
done
|