diff options
Diffstat (limited to 'src/op_mode/powerctrl.py')
-rwxr-xr-x | src/op_mode/powerctrl.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index cb4a175dd..c32a2be7d 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -24,7 +24,6 @@ from time import time from vyos.utils.io import ask_yes_no from vyos.utils.process import call -from vyos.utils.process import cmd from vyos.utils.process import run from vyos.utils.process import STDOUT @@ -117,11 +116,15 @@ def check_unsaved_config(): pass def execute_shutdown(time, reboot=True, ask=True): + from vyos.utils.process import cmd + check_unsaved_config() + host = cmd("hostname --fqdn") + action = "reboot" if reboot else "poweroff" if not ask: - if not ask_yes_no(f"Are you sure you want to {action} this system?"): + if not ask_yes_no(f"Are you sure you want to {action} this system ({host})?"): exit(0) action_cmd = "-r" if reboot else "-P" |