diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-04 17:13:59 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-04 17:13:59 +0100 |
commit | a96ffc33cc63918ba3815f66c506c717a8676621 (patch) | |
tree | f883f5976a40f2066f500363931a5e499374b8de /src/op_mode | |
parent | 26677aa3ce312a5b980ea88d57feebd09e39fd98 (diff) | |
parent | aceb4d7e187a571019e4bc24cd23efc7c2f624fe (diff) | |
download | vyos-1x-a96ffc33cc63918ba3815f66c506c717a8676621.tar.gz vyos-1x-a96ffc33cc63918ba3815f66c506c717a8676621.zip |
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x:
shutdown: T1826: Modify cancel reboot msg
T1801: move escaping of backslashes into configtree
vxlan: T1636: remove unused import statements
geneve: T1799: remove unused import statements
Diffstat (limited to 'src/op_mode')
-rwxr-xr-x | src/op_mode/powerctrl.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index e3644e063..46ebf5ffb 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -60,7 +60,11 @@ def check_shutdown(): def cancel_shutdown(): try: - cmd = check_output(["/sbin/shutdown","-c"]) + timenow = datetime.now().strftime('%Y-%m-%d %H:%M:%S') + cmd = check_output(["/sbin/shutdown","-c","--no-wall"]) + message = "Reboot scheduled has been cancelled %s" % timenow + #Generate broadcast message about cancel reboot + os.system("wall %s" % message) except CalledProcessError as e: sys.exit("Error aborting shutdown: %s" % e) @@ -105,7 +109,7 @@ def execute_shutdown(time, reboot = True, ask=True): else: sys.exit("Could not decode time and date") - print(cmd.decode().split(",",1)[0]) + check_shutdown() def chk_vyatta_based_reboots(): ### T870 commit-confirm is still using the vyatta code base, once gone, the code below can be removed |