1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

relayd: use an init script instead of a legacy network proto handler (fixes #11276)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31542 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd
2012-04-30 18:23:52 +00:00
parent e51f7c5d1b
commit 5bae60a024
4 changed files with 100 additions and 137 deletions

View File

@@ -1,36 +1,2 @@
#!/bin/sh
# Break recursion
[ "$PROTO" = "relay" ] && exit 0
include /lib/network
scan_interfaces
restart_relayd() {
local cfg="$1"
local proto
config_get proto "$1" proto
[ "$proto" = "relay" ] || return 0
local net networks
config_get networks "$cfg" network
for net in $networks; do
[ "$net" = "$INTERFACE" ] && {
env -i /sbin/ifup "$cfg" &
return 0
}
done
local ifn ifnames
config_get ifnames "$cfg" ifname
for ifn in $ifnames; do
[ "$ifn" = "$DEVICE" ] && {
env -i /sbin/ifup "$cfg" &
return 0
}
done
}
config_foreach restart_relayd interface
/etc/init.d/relayd enabled && /etc/init.d/relayd start