From ce9994f7caa3a82575b61b944b69b518b3508710 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 13 Dec 2011 00:25:58 -0600 Subject: 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. --- net/tuntap.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'net/tuntap.sh') diff --git a/net/tuntap.sh b/net/tuntap.sh index 45a80fe..679b097 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() -- cgit v1.2.3