From: Neszt Tibor Date: Thu, 7 Dec 2017 13:41:27 +0000 (+0100) Subject: crontab reboot commands in file X-Git-Url: http://git.neszt.hu/?a=commitdiff_plain;h=db5e76873ca6fba7f2d05375b21b9452cf0b52d3;p=yawep.git crontab reboot commands in file --- diff --git a/crontab_reboot b/crontab_reboot new file mode 100644 index 0000000..4a21a09 --- /dev/null +++ b/crontab_reboot @@ -0,0 +1 @@ +@reboot www-data while ! nc -z localhost 80 ; do sleep 0.1 ; done && curl 'http://127.0.0.1/yawep/index.php?config=1&start=1&bgonoff=true' diff --git a/index.php b/index.php index 148e525..90d5c1f 100755 --- a/index.php +++ b/index.php @@ -98,7 +98,7 @@ if ( isset($_GET['config']) ) { if ( isset($_GET['bootonoff']) ) { if ( $_GET['bootonoff'] == 'true' ) { $config['is_boot'] = 1; - exec("sudo sh -c 'echo @reboot www-data php-cgi7.0 -f /var/www/html/yawep/index.php config=1 start=1 bgonoff=true > $cron_file'"); + exec("sudo sh -c 'cp /var/www/html/yawep/crontab_reboot $cron_file'"); } else { $config['is_boot'] = 0; exec("sudo sh -c 'rm $cron_file'");