From da453c337f7799737ec6361299c0bcfd5f6e318c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 10 Jun 2010 22:59:31 +0200 Subject: [PATCH] network: Catch exit code of pppd. --- hooks/pppoe | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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() { -- 2.39.5