From: Dietmar Maurer Date: Thu, 6 Mar 2014 15:54:27 +0000 (+0100) Subject: ifupdown.sh: improve error handling X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=322bba26fb451ffbda7f2de7c19ff562ab98653d ifupdown.sh: improve error handling --- diff --git a/debian/ifupdown.sh b/debian/ifupdown.sh index e41efda..c124134 100755 --- a/debian/ifupdown.sh +++ b/debian/ifupdown.sh @@ -12,14 +12,14 @@ then fi if [ "${MODE}" = "start" ]; then - ifconfig "${IF_VETH_BRIDGETO}" up - ip link add name "${IFACE}" type veth peer name "${IFACE}peer" - ip link set "${IFACE}peer" up - brctl addif "${IF_VETH_BRIDGETO}" "${IFACE}peer" + ifconfig "${IF_VETH_BRIDGETO}" up || exit 1 + ip link add name "${IFACE}" type veth peer name "${IFACE}peer" || exit 1 + ip link set "${IFACE}peer" up || exit 1 + brctl addif "${IF_VETH_BRIDGETO}" "${IFACE}peer" || exit 1 elif [ "${MODE}" = "stop" ]; then brctl delif "${IF_VETH_BRIDGETO}" "${IFACE}peer" - ip link set "${IFACE}peer" down - ip link del "${IFACE}" + ip link set "${IFACE}peer" down || exit 1 + ip link del "${IFACE}" || exit 1 fi exit 0