From 8d3c8dadcfeb7ce8170c0ddec98a6d8fc6bc9756 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 26 Jun 2019 16:34:11 +0200 Subject: [PATCH] mwan3: add migration script for flush_conntrack config Signed-off-by: Florian Eckert --- .../mwan3-migrate-flush_conntrack | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 net/mwan3/files/etc/uci-defaults/mwan3-migrate-flush_conntrack diff --git a/net/mwan3/files/etc/uci-defaults/mwan3-migrate-flush_conntrack b/net/mwan3/files/etc/uci-defaults/mwan3-migrate-flush_conntrack new file mode 100644 index 0000000000..1691efa2d4 --- /dev/null +++ b/net/mwan3/files/etc/uci-defaults/mwan3-migrate-flush_conntrack @@ -0,0 +1,26 @@ +#!/bin/sh + +. /lib/functions.sh + +mwan3_migrate_flush_conntrack() { + local iface="$1" + + config_get value "${iface}" flush_conntrack + case $value in + always) + uci_remove mwan3 "$iface" flush_conntrack + uci_add_list mwan3 "$iface" flush_conntrack ifup + uci_add_list mwan3 "$iface" flush_conntrack ifdown + ;; + never) + uci_remove mwan3 "$iface" flush_conntrack + ;; + esac + + uci_commit mwan3 +} + +config_load mwan3 +config_foreach mwan3_migrate_flush_conntrack interface + +exit 0 -- 2.30.2