run.service | ●●●●● patch | view | raw | blame | history | |
run.sh | ●●●●● patch | view | raw | blame | history |
run.service
New file @@ -0,0 +1,13 @@ [Unit] Description=TTSS update service After=network.target [Service] Type=simple Restart=always RestartSec=1 User=www-data ExecStart=/usr/bin/php /path/to/run.sh [Install] WantedBy=multi-user.target run.sh
New file @@ -0,0 +1,16 @@ #!/bin/sh DIRNAME=$(dirname "$0") cd "${DIRNAME}" ( flock -n 200 || exit 1 while true do php download.php sleep 4 done ) 200>./lock