summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/live/ogOperations.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index a86db5c..6f759d7 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -190,7 +190,7 @@ class OgLiveOperations:
with open(logfile, 'wb', 0) as f:
f.truncate(0)
- def _poweroff_oglive(self):
+ def _poweroff_oglive(self, operation='poweroff'):
interface = os.getenv('DEVICE')
cmd_ethtool = shlex.split(f'ethtool -s {interface} wol g')
cmd_browser = shlex.split('pkill -9 browser')
@@ -198,7 +198,7 @@ class OgLiveOperations:
busybox = 'busybox'
else:
busybox = shutil.which('busyboxOLD')
- cmd_busybox = shlex.split(f'{busybox} poweroff')
+ cmd_busybox = shlex.split(f'{busybox} {operation}')
umount_all()
umount_cache()
@@ -219,9 +219,7 @@ class OgLiveOperations:
def reboot(self):
logging.info('Rebooting client')
if os.path.exists('/scripts/oginit'):
- cmd = f'source {ogClient.OG_PATH}etc/preinit/loadenviron.sh; ' \
- f'{ogClient.OG_PATH}scripts/reboot'
- subprocess.call([cmd], shell=True, executable=OG_SHELL)
+ self._poweroff_oglive(operation='reboot')
else:
subprocess.call(['/sbin/reboot'])