mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
💋 Sync 2026-10-04 04:16:09
This commit is contained in:
1 parent
f6b2df73ec
commit
f62992fd80
745 files changed
+212416
-1173
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# Flush conntrack when a watched WAN interface goes up or down.
|
||||
# Watched list = primary + backups from /etc/config/quickactions failover.
|
||||
|
||||
[ "$ACTION" = "ifup" ] || [ "$ACTION" = "ifdown" ] || exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
config_load quickactions
|
||||
|
||||
config_get WATCH failover primary ""
|
||||
config_get BACKUPS failover backups ""
|
||||
|
||||
IFACE="$INTERFACE"
|
||||
for i in $WATCH $BACKUPS; do
|
||||
if [ "$i" = "$IFACE" ]; then
|
||||
if [ -e /proc/net/nf_conntrack ]; then
|
||||
echo f > /proc/net/nf_conntrack
|
||||
elif [ -e /proc/net/ip_conntrack ]; then
|
||||
echo f > /proc/net/ip_conntrack
|
||||
fi
|
||||
logger -t quickactions-hotplug "IFACE $IFACE $ACTION; conntrack flushed"
|
||||
break
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
Reference in new issue
Block a user