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.
more_events
Alvaro Neira Ayuso 2019-12-12 18:47:02 +01:00 committed by Alvaro Neira Ayuso
parent 6479530bf5
commit 62a8ca4cd8
1 changed files with 7 additions and 1 deletions

View File

@ -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'