summaryrefslogtreecommitdiff
path: root/src/conf_mode/system-options.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-30 15:44:55 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-30 15:44:58 +0100
commit9b1cfeff18a23dfbefd485741ac4609c92707dfd (patch)
treeaf93aa1eb1ba5911ef445d249d50ffa78a61f530 /src/conf_mode/system-options.py
parentb9a6dab2d4f162eba59b9eec989b1de1b249f3fd (diff)
downloadvyos-1x-9b1cfeff18a23dfbefd485741ac4609c92707dfd.tar.gz
vyos-1x-9b1cfeff18a23dfbefd485741ac4609c92707dfd.zip
beep: T1920: migrate to systemd unit
Diffstat (limited to 'src/conf_mode/system-options.py')
-rwxr-xr-xsrc/conf_mode/system-options.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py
index 4c809d044..74c34e19f 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,6 +49,11 @@ 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':