summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2019-12-12 18:51:15 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commitdbbc7fa858f0d10321ad158afef94b8ffa0041bf (patch)
tree6a15a22acedd429a2560034eaea039595b32d34f
parent62a8ca4cd8a12871c1b03f2da9aaccd186d456e5 (diff)
Include the reboot support in ogOperation
This new patch allows us to reboot the linux machine using reboot binary or in OpenGnsys client case, use the specific script.
-rw-r--r--src/linux/ogOperations.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index ba141d9..79bff19 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -8,5 +8,7 @@ def poweroff():
subprocess.call(['/sbin/poweroff'])
def reboot():
- print 'REBOOT'
-
+ if os.path.exists('/scripts/oginit'):
+ subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/reboot', shell=True)
+ else:
+ subprocess.call(['/sbin/reboot'])