From c16efad4287cd0ec5731058b21aedd2c899bebf1 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 25 Feb 2011 23:23:40 +0000 Subject: relayd: add uci integration SVN-Revision: 25714 --- package/relayd/files/relay.hotplug | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/relayd/files/relay.hotplug (limited to 'package/relayd/files/relay.hotplug') diff --git a/package/relayd/files/relay.hotplug b/package/relayd/files/relay.hotplug new file mode 100644 index 0000000000..b992fca08c --- /dev/null +++ b/package/relayd/files/relay.hotplug @@ -0,0 +1,36 @@ +#!/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 + -- cgit v1.2.3