mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Tests: - Reboot works, the process works in the background showing apps page - Shutdown works, the process works in the background showing apps page Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
19 lines
330 B
Python
19 lines
330 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""Shutdown/restart the system."""
|
|
|
|
import subprocess
|
|
|
|
from plinth.actions import privileged
|
|
|
|
|
|
@privileged
|
|
def restart():
|
|
"""Restart the system."""
|
|
subprocess.call('reboot')
|
|
|
|
|
|
@privileged
|
|
def shutdown():
|
|
"""Shut down the system."""
|
|
subprocess.call(['shutdown', 'now'])
|