Skip to content

Commit

Permalink
Fix bug with adding proxy startup script to cron, now extraneous entr…
Browse files Browse the repository at this point in the history
…ies in crontab are not deleted - close #7
  • Loading branch information
Theo committed May 9, 2023
1 parent ccd8c6f commit 1b5023f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ipv6-proxy-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1b5023f

Please sign in to comment.