From: Neszt Tibor Date: Thu, 7 Dec 2017 14:16:50 +0000 (+0100) Subject: reboot function added X-Git-Url: http://git.neszt.hu/?a=commitdiff_plain;h=ee83d1071caf88275ed857b87d4be3cda00dc769;p=yawep.git reboot function added --- diff --git a/index.php b/index.php index 90d5c1f..07ffa60 100755 --- a/index.php +++ b/index.php @@ -85,6 +85,10 @@ if ( isset($_GET['config']) ) { exec("screen -X -S yawep_screen_player quit"); } + if ( isset($_GET['reboot']) ) { + + exec("sudo reboot"); + } if ( isset($_GET['bgonoff']) ) { if ( $_GET['bgonoff'] == 'true' ) { $config['is_bg'] = 1; @@ -151,8 +155,9 @@ if ( isset($_GET['config']) ) { print ""; print "
"; print ""; - print ""; + print ""; print ""; + print ""; print ""; print ""; print "
"; diff --git a/js/main.js b/js/main.js index c35296c..55f9cff 100644 --- a/js/main.js +++ b/js/main.js @@ -113,6 +113,20 @@ function init() { ; }) }); + $('button[name=reboot]').click(function() { + $.ajax({ + type: 'GET', + url: 'index.php', + dataType: 'json', + data: { config: '1', reboot: '1'} + }) + .done(function(msg) { + ; + }) + .fail(function(msg) { + ; + }) + }); $('button[name=status]').click(function() { $.ajax({ type: 'GET',