summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wirelessmodem.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-28 18:50:42 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-28 20:48:32 +0100
commita7b74971e5f19a3d460bf6666cbae9702154aa43 (patch)
tree31599eeedceabafe4ec51586c36def78543cc7bf /src/conf_mode/interfaces-wirelessmodem.py
parent2c6b33d3fcb88551d85c740288a916a1be76a8d3 (diff)
downloadvyos-1x-a7b74971e5f19a3d460bf6666cbae9702154aa43.tar.gz
vyos-1x-a7b74971e5f19a3d460bf6666cbae9702154aa43.zip
wwan: T1988: ppp: change order of debug and logfile options
Diffstat (limited to 'src/conf_mode/interfaces-wirelessmodem.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wirelessmodem.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py
index adb8bdc2d..14178d74c 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -44,11 +44,10 @@ demand
{% if name_server -%}
usepeerdns
{%- endif %}
-logfile {{ logfile }}
-
lcp-echo-failure 0
115200
debug
+logfile {{ logfile }}
nodefaultroute
ipcp-max-failure 4
ipcp-accept-local
@@ -58,7 +57,7 @@ crtscts
lock
persist
-connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/{{ intf }}.chat'
+connect '/usr/sbin/chat -v -t6 -f {{ chat_script }}'
"""
@@ -76,6 +75,7 @@ CONNECT ''
default_config_data = {
'address': [],
'apn': '',
+ 'chat_script': '',
'deleted': False,
'description': '',
'device': 'ttyUSB0',
@@ -110,6 +110,7 @@ def get_config():
wwan['intf'] = os.environ['VYOS_TAGNODE_VALUE']
wwan['logfile'] = f"/var/log/vyatta/ppp_{wwan['intf']}.log"
+ wwan['chat_script'] = f"/etc/ppp/peers/chat.{wwan['intf']}"
# Check if interface has been removed
if not conf.exists('interfaces wirelessmodem ' + wwan['intf']):
@@ -173,7 +174,6 @@ def verify(wwan):
def generate(wwan):
config_file_wwan = f"/etc/ppp/peers/{wwan['intf']}"
- chat_file_wwan = f"/etc/ppp/peers/{wwan['intf']}.chat"
# Always hang-up WWAN connection prior generating new configuration file
cmd = f"systemctl stop ppp@{wwan['intf']}.service"
@@ -183,8 +183,8 @@ def generate(wwan):
# Delete PPP configuration files
if os.path.exists(config_file_wwan):
os.unlink(config_file_wwan)
- if os.path.exists(chat_file_wwan):
- os.unlink(chat_file_wwan)
+ if os.path.exists(wwan['chat_script']):
+ os.unlink(wwan['chat_script'])
else:
# Create PPP configuration files
@@ -197,7 +197,7 @@ def generate(wwan):
# Create PPP chat script
tmpl = Template(chat_wwan_tmpl)
config_text = tmpl.render(wwan)
- with open(chat_file_wwan, 'w') as f:
+ with open(wwan['chat_script'], 'w') as f:
f.write(config_text)
return None