From: Michael Tremer Date: Thu, 10 Jun 2010 20:59:31 +0000 (+0200) Subject: network: Catch exit code of pppd. X-Git-Tag: 001~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da453c337f7799737ec6361299c0bcfd5f6e318c;p=network.git network: Catch exit code of pppd. --- diff --git a/hooks/pppoe b/hooks/pppoe index 7900e38f..5e18b84f 100755 --- a/hooks/pppoe +++ b/hooks/pppoe @@ -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() {