Files
bunny2realip/run.sh
Marco Dalla Stella c957863f2d Correct syntax errors in log_message calls
- Remove parentheses from log_message calls which were causing syntax errors
- Add missing space in if statement condition check
2025-09-28 10:34:18 +02:00

21 lines
479 B
Bash
Executable File

#!/bin/bash
# Function to log messages with a timestamp
log_message() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"
}
log_message "Update Bunny IPs list..."
bb -m bunny2realip.core
if [ $? -eq 0 ]; then
log_message "Reload nginx configuration..."
systemctl reload nginx
if [ $? -eq 0 ]; then
log_message "Update successfully!"
else
log_message "nginx: Something went wrong!"
fi
else
log_message "bunny2realip: Something went wrong!"
fi