Return better error codes when we fail.
authorRoy Marples <roy@marples.name>
Fri, 9 Nov 2007 13:24:31 +0000 (13:24 +0000)
committerRoy Marples <roy@marples.name>
Fri, 9 Nov 2007 13:24:31 +0000 (13:24 +0000)
resolvconf

index 5f546c2b0c16b3db8d554a2a1a8a83d4e4f800f4..7484314a2369632f9a86429dea7f81fedaac50bb 100755 (executable)
@@ -219,18 +219,24 @@ else
        if [ "x${CMD}" = "x-a" -o "x${CMD}" = "x-d" ]; then
                cd "${IFACEDIR}"
                for iface in ${IFACE}; do
-                       rm -f "${iface}"
+                       rm -f "${iface}" || exit $?
                done
        fi
 fi
 
 if [ "x${CMD}" = "x-a" ]; then
        # Create our resolv.conf file
-       cat >"${IFACEDIR}"/"${IFACE}"
+       cat >"${IFACEDIR}"/"${IFACE}" || exit $?
 fi
 
+retval=0
 for x in "${UPDATED}"/*; do
-       [ -e "${x}" ] && "${x}" "${CMD}" "${IFACE}"
+       if [ -e "${x}" ]; then
+               "${x}" "${CMD}" "${IFACE}"
+               retval=$((${retval} + $?))
+       fi
 done
 
+exit ${retval}
+
 # vim: set ts=4 :