From 3e3753d726f8a02d98368f20f77dd9fa739e3d80 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 3 Jun 2023 01:00:49 +0300 Subject: add various scripts to not lose them --- misc/openwrt/etc/hotplug.d/iface/99-ifup | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 misc/openwrt/etc/hotplug.d/iface/99-ifup (limited to 'misc/openwrt/etc/hotplug.d') 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 -- cgit v1.2.3