summaryrefslogtreecommitdiff
path: root/src/conf_mode/system-options.py
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2019-12-31 00:04:10 +0200
committerzsdc <taras@vyos.io>2019-12-31 00:04:10 +0200
commit7fcbd30b3357a047c57db39d0b07ed797f1392df (patch)
tree9f12afa73557425be1e65cbb3a18d0efaa2fc5f7 /src/conf_mode/system-options.py
parentf7eda283b6eefbbc349384c22a1e15a1d24ae384 (diff)
parentc7b0585fa97779fc070f4a4a0fe825eb0729023c (diff)
downloadvyos-1x-7fcbd30b3357a047c57db39d0b07ed797f1392df.tar.gz
vyos-1x-7fcbd30b3357a047c57db39d0b07ed797f1392df.zip
Merge remote-tracking branch 'upstream/current' into T1514
Diffstat (limited to 'src/conf_mode/system-options.py')
-rwxr-xr-xsrc/conf_mode/system-options.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py
index 4c809d044..a893e98b3 100755
--- a/src/conf_mode/system-options.py
+++ b/src/conf_mode/system-options.py
@@ -24,6 +24,7 @@ from vyos import ConfigError
systemd_ctrl_alt_del = '/lib/systemd/system/ctrl-alt-del.target'
default_config_data = {
+ 'beep_if_fully_booted': False,
'ctrl_alt_del': 'ignore',
'reboot_on_panic': True
}
@@ -36,6 +37,7 @@ def get_config():
if conf.exists('ctrl-alt-del-action'):
opt['ctrl_alt_del'] = conf.return_value('ctrl-alt-del-action')
+ opt['beep_if_fully_booted'] = conf.exists('beep-if-fully-booted')
opt['reboot_on_panic'] = conf.exists('reboot-on-panic')
return opt
@@ -47,10 +49,16 @@ def generate(opt):
pass
def apply(opt):
+ # Beep action
+ if opt['beep_if_fully_booted']:
+ os.system('systemctl enable vyos-beep.service >/dev/null 2>&1')
+ else:
+ os.system('systemctl disable vyos-beep.service >/dev/null 2>&1')
# Ctrl-Alt-Delete action
if opt['ctrl_alt_del'] == 'ignore':
- os.unlink('/lib/systemd/system/ctrl-alt-del.target')
+ if os.path.exists(systemd_ctrl_alt_del):
+ os.unlink('/lib/systemd/system/ctrl-alt-del.target')
elif opt['ctrl_alt_del'] == 'reboot':
if os.path.exists(systemd_ctrl_alt_del):