From: Michael Tremer Date: Thu, 10 Jun 2010 20:59:31 +0000 (+0200) Subject: network: Catch exit code of pppd. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=689dccf210b7ee706559fb2cdf932250d686656e;p=ipfire-3.x.git network: Catch exit code of pppd. --- diff --git a/pkgs/core/network/src/hooks/pppoe b/pkgs/core/network/src/hooks/pppoe index 7900e38f9..5e18b84f1 100755 --- a/pkgs/core/network/src/hooks/pppoe +++ b/pkgs/core/network/src/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() {