blob: e3d69e21e5da022994cf7e0a526997a29f002dba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import os
import subprocess
OG_PATH = '/opt/opengnsys/'
def poweroff():
if os.path.exists('/scripts/oginit'):
subprocess.call('source ' + OG_SCRIPT_PATH + 'etc/preinit/loadenviron.sh; ' + OG_SCRIPT_PATH + 'scripts/poweroff', shell=True)
else:
subprocess.call(['/sbin/poweroff'])
def reboot():
if os.path.exists('/scripts/oginit'):
subprocess.call('source ' + OG_SCRIPT_PATH + 'etc/preinit/loadenviron.sh; ' + OG_SCRIPT_PATH + 'scripts/reboot', shell=True)
else:
subprocess.call(['/sbin/reboot'])
|