summaryrefslogtreecommitdiffstats
path: root/src/linux/ogOperations.py
blob: 79bff19d415301a43e777f809ff8b632fff1bc8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os
import subprocess

def poweroff():
	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():
	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'])