aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-12-13 00:25:58 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-12-13 00:25:58 -0600
commitce9994f7caa3a82575b61b944b69b518b3508710 (patch)
tree7dea8b3f8360945cf965f105fe9dee9c61d88f32
parenta38a5071f3ddcde7f18514d4d669d2bc0fde2736 (diff)
net/tuntap: fix return code when tools can't be found
This module should return failure if iproute2, openvpn or tunctl cannot be found. Before it was returning success; this fixes the issue.
-rw-r--r--net/tuntap.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/tuntap.sh b/net/tuntap.sh
index 45a80fe7..679b0978 100644
--- a/net/tuntap.sh
+++ b/net/tuntap.sh
@@ -16,6 +16,7 @@ _is_tuntap()
tuntap_pre_start()
{
local tuntap=
+ local rc=
eval tuntap=\$tuntap_${IFVAR}
[ -z "${tuntap}" ] && return 0
@@ -66,16 +67,20 @@ tuntap_pre_start()
if ${do_iproute2}; then
ip tuntap add dev "${IFACE}" mode "${tuntap}" ${i_opts}
+ rc=$?
elif ${do_openvpn}; then
openvpn --mktun --dev-type "${tuntap}" --dev "${IFACE}" \
${o_opts} >/dev/null
+ rc=$?
elif ${do_tunctl}; then
tunctl ${t_opts} -t "${IFACE}" >/dev/null
+ rc=$?
else
eerror "Neither iproute2, openvpn nor tunctl has been found, please install"
eerror "either \"iproute2\" \"openvpn\" or \"usermode-utilities\"."
+ rc=1
fi
- eend $? && _up && service_set_value tuntap "${tuntap}"
+ eend $rc && _up && service_set_value tuntap "${tuntap}"
}
tuntap_post_stop()