summaryrefslogtreecommitdiff
path: root/package/ez-ipupdate/files/ez-ipupdate.hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'package/ez-ipupdate/files/ez-ipupdate.hotplug')
-rw-r--r--package/ez-ipupdate/files/ez-ipupdate.hotplug12
1 files changed, 8 insertions, 4 deletions
diff --git a/package/ez-ipupdate/files/ez-ipupdate.hotplug b/package/ez-ipupdate/files/ez-ipupdate.hotplug
index 56a054b4ac..eb7ab326c4 100644
--- a/package/ez-ipupdate/files/ez-ipupdate.hotplug
+++ b/package/ez-ipupdate/files/ez-ipupdate.hotplug
@@ -1,6 +1,10 @@
-PGM=ez-ipupdate
+. /etc/functions.sh
+NAME=ez-ipupdate
+CONFIG=/etc/$NAME.conf
+COMMAND=/usr/sbin/$NAME
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
- [ -e /etc/$PGM.conf ] && {
- [ -n $(grep "user=" /etc/$PGM.conf | cut -d= -f2 | cut -d: -f1) ] && [ -n $(grep "user=" /etc/$PGM.conf | cut -d= -f2 | cut -d: -f2) ] && /usr/sbin/$PGM -c /etc/$PGM.conf &
- }
+ [ -x $COMMAND ] && [ -r $CONFIG ] && {
+ IFNAME=$(nvram get ${INTERFACE}_ifname)
+ $COMMAND -c $CONFIG -i $IFNAME 2>&1 | logger -t $NAME
+ } &
}