diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-27 18:33:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 18:33:09 +0100 |
commit | 1b607b956b62e2a005077e9a103546423b87da49 (patch) | |
tree | 1263b82bcb62d96714acf998ed1b7c2919d29d0b /src/conf_mode/interfaces-pppoe.py | |
parent | ca1f38a189e2e5b82d0821455d7b64eb385ace22 (diff) | |
parent | 7630f2c915c27bceabcc808fcd9d29ed198b9dbe (diff) | |
download | vyos-1x-1b607b956b62e2a005077e9a103546423b87da49.tar.gz vyos-1x-1b607b956b62e2a005077e9a103546423b87da49.zip |
Merge pull request #703 from DmitriyEshenko/pppoe-client-2701202101
pppoe: T3261: Stop systemd service if pppoe interface disable
Diffstat (limited to 'src/conf_mode/interfaces-pppoe.py')
-rwxr-xr-x | src/conf_mode/interfaces-pppoe.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py index f49792a7a..3675db73b 100755 --- a/src/conf_mode/interfaces-pppoe.py +++ b/src/conf_mode/interfaces-pppoe.py @@ -73,7 +73,7 @@ def generate(pppoe): config_files = [config_pppoe, script_pppoe_pre_up, script_pppoe_ip_up, script_pppoe_ip_down, script_pppoe_ipv6_up, config_wide_dhcp6c] - if 'deleted' in pppoe: + if 'deleted' in pppoe or 'disable' in pppoe: # stop DHCPv6-PD client call(f'systemctl stop dhcp6c@{ifname}.service') # Hang-up PPPoE connection @@ -110,13 +110,11 @@ def generate(pppoe): return None def apply(pppoe): - if 'deleted' in pppoe: - # bail out early + if 'deleted' in pppoe or 'disable' in pppoe: + call('systemctl stop ppp@{ifname}.service'.format(**pppoe)) return None - if 'disable' not in pppoe: - # Dial PPPoE connection - call('systemctl restart ppp@{ifname}.service'.format(**pppoe)) + call('systemctl restart ppp@{ifname}.service'.format(**pppoe)) return None |