From 8ad51325ce5e69b892e76d10f65aa2c20d2a083d Mon Sep 17 00:00:00 2001 From: daniele Date: Thu, 29 Oct 2026 07:00:02 +0100 Subject: [PATCH] Backup automatico script del 2026-10-29 07:00 --- scripts/pi1-master/ipupdate.sh | 2 ++ scripts/pi2-backup/ipupdate.sh | 25 +------------------------ 2 files changed, 3 insertions(+), 24 deletions(-) create mode 100755 scripts/pi1-master/ipupdate.sh diff --git a/scripts/pi1-master/ipupdate.sh b/scripts/pi1-master/ipupdate.sh new file mode 100755 index 0000000..217f957 --- /dev/null +++ b/scripts/pi1-master/ipupdate.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec /home/daniely/rete/scripts/dnsexit-update.sh diff --git a/scripts/pi2-backup/ipupdate.sh b/scripts/pi2-backup/ipupdate.sh index dd14f12..217f957 100755 --- a/scripts/pi2-backup/ipupdate.sh +++ b/scripts/pi2-backup/ipupdate.sh @@ -1,25 +1,2 @@ #!/bin/bash - -# Set curl command to update the IP -command="curl https://api.dnsexit.com/dns/ud/?apikey=2r6YilHU9YzFt2vKBT4W8A347e7w3G -d host=loogle.it,assd.sm" - -if [ -d "/var/log" ]; then - command="$command >> /var/log/ipupdate.log" -fi - -# Get the existing crontab content -existing_crontab=$(crontab -l 2>/dev/null) - -# Check if the command is already in crontab -if [[ $existing_crontab == *"$command"* ]]; then - echo "Scheduled job already exists in crontab." -else - # Add the scheduled job to the existing crontab content - new_crontab="${existing_crontab} -*/12 * * * * $command" - - # Install the modified crontab - echo "$new_crontab" | crontab - - echo "The following job has been added to crontab. You may use command "crontab -l" to view the job" - crontab -l | grep curl -fi +exec /home/daniely/rete/scripts/dnsexit-update.sh