summaryrefslogtreecommitdiff
path: root/src/conf_mode/load-balancing-wan.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-05-06 15:05:53 +0200
committerGitHub <noreply@github.com>2023-05-06 15:05:53 +0200
commitd4352bed66857a2e4f1b124abcf6cf1910621506 (patch)
tree60fdea95446880a882b862750368670deaf60d92 /src/conf_mode/load-balancing-wan.py
parentf7fc3ea77e4b42aaf7968a42b2b42d070a31fbaa (diff)
parent454fcea2a3a08181aa9d8d84e1576379cf228c6f (diff)
downloadvyos-1x-d4352bed66857a2e4f1b124abcf6cf1910621506.tar.gz
vyos-1x-d4352bed66857a2e4f1b124abcf6cf1910621506.zip
Merge pull request #1980 from sever-sever/T5203
T5203: Add systemd vyos-wan-load-balance.service
Diffstat (limited to 'src/conf_mode/load-balancing-wan.py')
-rwxr-xr-xsrc/conf_mode/load-balancing-wan.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/load-balancing-wan.py b/src/conf_mode/load-balancing-wan.py
index 2f0cf1293..7086aaf8b 100755
--- a/src/conf_mode/load-balancing-wan.py
+++ b/src/conf_mode/load-balancing-wan.py
@@ -31,6 +31,7 @@ airbag.enable()
load_balancing_dir = '/run/load-balance'
load_balancing_conf_file = f'{load_balancing_dir}/wlb.conf'
+systemd_service = 'vyos-wan-load-balance.service'
def get_config(config=None):
@@ -158,13 +159,13 @@ def generate(lb):
def apply(lb):
if not lb:
try:
- cmd('sudo /opt/vyatta/sbin/vyatta-wanloadbalance.init stop')
+ cmd(f'systemctl stop {systemd_service}')
except Exception as e:
print(f"Error message: {e}")
else:
cmd('sudo sysctl -w net.netfilter.nf_conntrack_acct=1')
- cmd(f'sudo /opt/vyatta/sbin/vyatta-wanloadbalance.init restart {load_balancing_conf_file}')
+ cmd(f'systemctl restart {systemd_service}')
return None