No shutdown delay after sleeping.

This commit is contained in:
Roland 2023-08-18 11:59:11 -06:00
parent 4cc00a9cb1
commit 434d432e8a
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -159,7 +159,8 @@ async def shutdown(reboot: bool = False, delay: int = 10):
await asyncio.sleep(delay)
try:
cmd = f'{SUDO_BIN} shutdown {reboot}'
# Call shutdown (or reboot) with no delay now that we have slept.
cmd = f'{SUDO_BIN} shutdown {reboot} 0'
proc = await asyncio.create_subprocess_shell(cmd, stderr=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE)
stdout, stderr = await proc.communicate()