From 1b5023faafb671c4b50b495d6d8a7b28db81128a Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 9 May 2023 09:44:01 +0300 Subject: [PATCH] Fix bug with adding proxy startup script to cron, now extraneous entries in crontab are not deleted - close #7 --- ipv6-proxy-server.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipv6-proxy-server.sh b/ipv6-proxy-server.sh index 2e9ef33..aff7e6e 100644 --- a/ipv6-proxy-server.sh +++ b/ipv6-proxy-server.sh @@ -294,6 +294,11 @@ function add_to_cron(){ # Add startup script to cron (job sheduler) to restart proxy server after reboot and rotate proxy pool echo "@reboot $bash_location $startup_script_path" > $cron_script_path; if [ $rotating_interval -ne 0 ]; then echo "*/$rotating_interval * * * * $bash_location $startup_script_path" >> "$cron_script_path"; fi; + + # Add existing cron rules (not related to this proxy server) to cron script, so that they are not removed + # https://unix.stackexchange.com/questions/21297/how-do-i-add-an-entry-to-my-crontab + crontab -l | grep -v $startup_script_path >> $cron_script_path; + crontab $cron_script_path; systemctl restart cron;