mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
- This is to capture stdout and stderr and transmit that from privileged daemon back to the service to be displayed in HTML. Tests: - Unit tests and code checks pass. - Some of the modified actions work as expected. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
18 lines
371 B
Python
18 lines
371 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""Shutdown/restart the system."""
|
|
|
|
from plinth import action_utils
|
|
from plinth.actions import privileged
|
|
|
|
|
|
@privileged
|
|
def restart():
|
|
"""Restart the system."""
|
|
action_utils.run('reboot', check=False)
|
|
|
|
|
|
@privileged
|
|
def shutdown():
|
|
"""Shut down the system."""
|
|
action_utils.run(['shutdown', 'now'], check=False)
|