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