mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Fixing shutdown/reboot call to use new .
This commit is contained in:
parent
612682f3bf
commit
21919b3783
1 changed files with 1 additions and 2 deletions
|
|
@ -196,14 +196,13 @@ async def shutdown(reboot: bool = False, delay: int = 10):
|
|||
if DOCKERIZED:
|
||||
raise ShutdownFailed('Cannot Reboot because we are dockerized')
|
||||
|
||||
reboot = '--reboot' if reboot else ''
|
||||
cmd = (SUDO_BIN, 'shutdown', '--reboot', '0') if reboot else (SUDO_BIN, 'shutdown', '0')
|
||||
|
||||
async def _():
|
||||
await asyncio.sleep(delay)
|
||||
|
||||
try:
|
||||
# Call shutdown (or reboot) with no delay now that we have slept.
|
||||
cmd = [SUDO_BIN, 'shutdown', 'reboot', '0']
|
||||
result = await run_command(cmd)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if reboot:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue