From d96256fd87b8f4e928d8b3155b14d56170cd59dc Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Sat, 27 Jan 2018 12:45:37 -0700 Subject: [PATCH] Add reboot/shutdown entries when not in X --- .bin/Scripts/functions/hw_diags.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 99a6a3ed..e75849b8 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -83,6 +83,13 @@ def menu_diags(*args): {'Letter': 'Q', 'Name': 'Quit', 'CRLF': True}, ] + # CLI-mode actions + if 'DISPLAY' not in global_vars['Env']: + actions.extend([ + {'Letter': 'R', 'Name': 'Reboot', 'CRLF': True}, + {'Letter': 'S', 'Name': 'Shutdown'}, + ]) + # Quick disk check if 'quick' in args: run_tests(['Quick', 'NVMe/SMART']) @@ -118,6 +125,10 @@ def menu_diags(*args): run_program( 'pipes -t 0 -t 1 -t 2 -t 3 -p 5 -R -r 4000'.split(), check=False, pipe=False) + elif selection == 'R': + run_program(['reboot']) + elif selection == 'S': + run_program(['poweroff']) elif selection == 'Q': break