diff options
Diffstat (limited to 'src/conf_mode/interfaces-wirelessmodem.py')
-rwxr-xr-x | src/conf_mode/interfaces-wirelessmodem.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 388d98f4e..93f60d038 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -32,6 +32,9 @@ config_wwan_tmpl = """### Autogenerated by interfaces-wirelessmodem.py ### # {{ description }} {% endif %} +# physical device +/dev/{{ device }} + ipparam {{ intf }} {{ metric }} {% if on_demand -%} demand @@ -53,6 +56,7 @@ crtscts lock persist + """ default_config_data = { @@ -136,9 +140,14 @@ def get_config(): return wwan def verify(wwan): - if wwan is None: + if wwan['deleted']: return None + # we can not use isfile() here as Linux device files are no regular files + # thus the check will return False + if not os.path.exists(f"/dev/{wwan['device']}"): + raise ConfigError(f"Device {wwan['device']} does not exist") + return None def generate(wwan): |