From: Michael Tremer Date: Sun, 18 Jul 2010 21:06:45 +0000 (+0200) Subject: network: Logging changes on ip-updown. X-Git-Url: http://git.ipfire.org/?p=people%2Farne_f%2Fnetwork.git;a=commitdiff_plain;h=39924ed13d47339094db1b453cf0b00f7b7f13d3 network: Logging changes on ip-updown. pppd will not be able to print any error messages so we use assert which will dump a possible error to the log file. --- diff --git a/ppp/ip-updown b/ppp/ip-updown index cc746a13..8e9751a6 100755 --- a/ppp/ip-updown +++ b/ppp/ip-updown @@ -22,8 +22,6 @@ umask 022 export PATH=/usr/sbin:/sbin:/usr/bin:/bin -exec &>/tmp/network.$(basename $0) - # Give the variables we get passed by pppd an own namespace for i in IFNAME IPLOCAL IPREMOTE DNS1 DNS2 MACREMOTE; do export PPP_${i}=${!i} @@ -36,19 +34,11 @@ done ZONE=${PPP_IFNAME} assert isset ZONE - -if ! zone_exists ${ZONE}; then - error "Zone '${ZONE}' does not exist." - exit ${EXIT_ERROR} -fi +assert zone_exists ${ZONE} HOOK=$(zone_get_hook ${ZONE}) assert isset HOOK - -if ! hook_zone_exists ${HOOK}; then - error "Hook '${HOOK}' does not exist." - exit ${EXIT_ERROR} -fi +assert hook_zone_exists ${HOOK} hook_zone_exec ${HOOK} ppp-$(basename ${0}) ${ZONE}