sxmo_suspend.sh: fix rtcwake to use sudo

This commit is contained in:
2024-01-01 06:38:43 +00:00
parent 92d193ffe3
commit 49527edaa9

View File

@@ -124,7 +124,7 @@ class Suspender:
def suspend(self, duration: int, mode: str): def suspend(self, duration: int, mode: str):
logger.info(f"calling suspend for duration: {duration}") logger.info(f"calling suspend for duration: {duration}")
if mode == 'rtcwake': if mode == 'rtcwake':
self.executor.exec(['rtcwake', '-m', 'mem', '-s', str(duration)], check=False) self.executor.exec(['rtcwake', '-m', 'mem', '-s', str(duration)], sudo=True, check=False)
elif mode == 'sleep': elif mode == 'sleep':
time.sleep(duration) time.sleep(duration)
else: else: