diff options
author | Christian Poessinger <christian@poessinger.com> | 2018-06-24 11:49:51 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2018-06-24 11:49:51 +0200 |
commit | 220687ae79e5bdae424a6376cad8857cfddd6e18 (patch) | |
tree | ba616776cb59ae231ba6627e5c47d3c1b417c6cf /src/conf_mode/beep_if_fully_booted.py | |
parent | a502b156a028ff89985d590656d6078bf5175f35 (diff) | |
download | vyos-1x-220687ae79e5bdae424a6376cad8857cfddd6e18.tar.gz vyos-1x-220687ae79e5bdae424a6376cad8857cfddd6e18.zip |
T201: remove systemd dependency which is unneeded
Diffstat (limited to 'src/conf_mode/beep_if_fully_booted.py')
-rwxr-xr-x | src/conf_mode/beep_if_fully_booted.py | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/conf_mode/beep_if_fully_booted.py b/src/conf_mode/beep_if_fully_booted.py index 1311cba62..f00fcabd0 100755 --- a/src/conf_mode/beep_if_fully_booted.py +++ b/src/conf_mode/beep_if_fully_booted.py @@ -17,30 +17,26 @@ # import sys -import subprocess +import os from vyos.config import Config from vyos import ConfigError def get_config(): - conf = Config() - if not conf.exists('system options beep-if-fully-booted'): - return 1 - else: - return 0 + conf = Config() + if not conf.exists('system options beep-if-fully-booted'): + return None + + return True def apply(status): - if status == 1: - rc = subprocess.call(['/bin/systemctl -q disable beep'], shell=True) - return rc - elif status == 0: - rc = subprocess.call(['/bin/systemctl -q enable beep'], shell=True) - return rc + if status is not None: + os.system('/usr/bin/beep -f 130 -l 100 -n -f 262 -l 100 -n -f 330 -l 100 -n -f 392 -l 100 -n -f 523 -l 100 -n -f 660 -l 100 -n -f 784 -l 300 -n -f 660 -l 300') if __name__ == '__main__': - try: - c = get_config() - apply(c) - except ConfigError as e: - print(e) - sys.exit(1) + try: + c = get_config() + apply(c) + except ConfigError as e: + print(e) + sys.exit(1) |