]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Catch exit code of pppd.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2010 20:59:31 +0000 (22:59 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2010 20:59:31 +0000 (22:59 +0200)
hooks/pppoe

index 7900e38f9a76f24dc91763ad19f4359891b6a2dc..5e18b84f1525b921d3e2bad5483a386da3f8abbc 100755 (executable)
@@ -167,7 +167,19 @@ EOF
 
        pppd file ${RED_RUN}/${LINKNAME}/options >/dev/null
 
-       exit ${EXIT_OK}
+       local ret=$?
+
+       # Get exit code from ppp daemon and handle it:
+       case "${ret}" in
+               0)
+                       log DEBUG "pppd detached successfully"
+                       exit ${EXIT_OK}
+                       ;;
+       esac
+
+       error_log "pppd exited with unknown exit code '${ret}'"
+
+       exit ${EXIT_ERROR}
 }
 
 function _down() {