1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-26 23:34:36 +02:00
openwrt-xburst/package/relayd/files/relay.hotplug
jow 1e09ab8b72 [backfire] backport relayd, libubox and libjson-c
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@25718 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-02-26 00:12:42 +00:00

37 lines
589 B
Bash

#!/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