]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Logging changes on ip-updown.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Jul 2010 21:06:45 +0000 (23:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Jul 2010 21:06:45 +0000 (23:06 +0200)
pppd will not be able to print any error messages
so we use assert which will dump a possible error
to the log file.

ppp/ip-updown

index cc746a13f7032718203f962e48124fd731b32cb1..8e9751a69d5c88e0dbd0a1fcef31bddfde1536c3 100755 (executable)
@@ -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}