-PGM=ez-ipupdate
+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 ] && {
+ eval "ifname=\"\${${INTERFACE}_ifname}\""
+ $COMMAND -c $CONFIG -i $ifname 2>&1 | logger -t $NAME
+ } &
}