From 539c4e58723fbd3b8ca9f30a09e99ddaf72c30b1 Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Fri, 16 Sep 2011 23:47:20 +0200
Subject: Print a warning if openvpn/tunctl are missing

---
 net/tuntap.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'net')

diff --git a/net/tuntap.sh b/net/tuntap.sh
index 851a017b..14ffddb0 100644
--- a/net/tuntap.sh
+++ b/net/tuntap.sh
@@ -54,15 +54,18 @@ tuntap_pre_start()
 		do_tunctl=true
 	elif type openvpn >/dev/null 2>&1; then
 		do_openvpn=true
-	else
+	elif type tunctl >/dev/null 2>&1; then
 		do_tunctl=true
 	fi
 
 	if ${do_openvpn}; then
 		openvpn --mktun --dev-type "${tuntap}" --dev "${IFACE}" \
 			${o_opts} >/dev/null
-	else
+	elif ${do_tunctl}; then
 		tunctl ${t_opts} -t "${IFACE}" >/dev/null
+	else
+		eerror "Neither openvpn nor tunctl has been found, please install"
+		eerror "either net-misc/openvpn or sys-apps/usermode-utilities."
 	fi
 	eend $? && _up && service_set_value tuntap "${tuntap}"
 }
-- 
cgit v1.2.3