From 62a8ca4cd8a12871c1b03f2da9aaccd186d456e5 Mon Sep 17 00:00:00 2001 From: Alvaro Neira Ayuso Date: Thu, 12 Dec 2019 18:47:02 +0100 Subject: Include the poweroff support in ogOperation This new patch allows us to turn off the linux machine using poweroff binary or in OpenGnsys client case, use the specific script. --- src/linux/ogOperations.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/linux') diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py index d6795b1..ba141d9 100644 --- a/src/linux/ogOperations.py +++ b/src/linux/ogOperations.py @@ -1,5 +1,11 @@ +import os +import subprocess + def poweroff(): - print 'APAGADO' + if os.path.exists('/scripts/oginit'): + subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/poweroff', shell=True) + else: + subprocess.call(['/sbin/poweroff']) def reboot(): print 'REBOOT' -- cgit v1.2.3-18-g5258