crontab reboot commands in file
authorNeszt Tibor <neszt.tibor@euronetrt.hu>
Thu, 7 Dec 2017 13:41:27 +0000 (14:41 +0100)
committerNeszt Tibor <neszt.tibor@euronetrt.hu>
Thu, 7 Dec 2017 13:41:27 +0000 (14:41 +0100)
crontab_reboot [new file with mode: 0644]
index.php

diff --git a/crontab_reboot b/crontab_reboot
new file mode 100644 (file)
index 0000000..4a21a09
--- /dev/null
@@ -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'
index 148e525..90d5c1f 100755 (executable)
--- 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'");