summaryrefslogtreecommitdiff
path: root/misc/openwrt/etc/hotplug.d/iface
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-06-03 01:00:49 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-06-03 01:00:49 +0300
commit3e3753d726f8a02d98368f20f77dd9fa739e3d80 (patch)
tree09622bb713c8065952cf9cb37111285a5389bf09 /misc/openwrt/etc/hotplug.d/iface
parenta1c7aff91f38473481590489f41b86d41df9a29d (diff)
add various scripts to not lose them
Diffstat (limited to 'misc/openwrt/etc/hotplug.d/iface')
-rw-r--r--misc/openwrt/etc/hotplug.d/iface/99-ifup21
1 files changed, 21 insertions, 0 deletions
diff --git a/misc/openwrt/etc/hotplug.d/iface/99-ifup b/misc/openwrt/etc/hotplug.d/iface/99-ifup
new file mode 100644
index 0000000..e3562cd
--- /dev/null
+++ b/misc/openwrt/etc/hotplug.d/iface/99-ifup
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+tables="mts-azov rt-azov mts-il"
+net=
+
+case "$ACTION" in
+ ifup)
+ case "$INTERFACE" in
+ eth2)
+ net=192.168.7
+ ;;
+ eth3)
+ net=192.168.8
+ ;;
+ esac
+ if [ -z "$net" ]; then exit; fi
+ for t in $tables; do
+ ip r add ${net}.0/24 via ${net}.1 table $t
+ done
+ ;;
+esac \ No newline at end of file