Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
archive/package/relayd/files/relay.hotplug
Jo-Philipp Wich 20478b7004 [backfire] backport relayd, libubox and libjson-c
SVN-Revision: 25718
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