aboutsummaryrefslogtreecommitdiffstats
path: root/main/openvpn/openvpn.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-05-06 13:44:18 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-05-06 21:30:15 +0200
commitd2e0d2c599f08f03f98ad0e59cdeb6a4f4ac294e (patch)
treebc2998931d1ebe2db7168d56fb8a38ef214143f3 /main/openvpn/openvpn.initd
parent733e23a8f6ea3d812ea236a983b67c8bc608f942 (diff)
downloadaports-d2e0d2c599f08f03f98ad0e59cdeb6a4f4ac294e.tar.bz2
aports-d2e0d2c599f08f03f98ad0e59cdeb6a4f4ac294e.tar.xz
main/openvpn: remove non-Linux part from init script
Diffstat (limited to 'main/openvpn/openvpn.initd')
-rw-r--r--main/openvpn/openvpn.initd45
1 files changed, 11 insertions, 34 deletions
diff --git a/main/openvpn/openvpn.initd b/main/openvpn/openvpn.initd
index 20c142f4cf..5a07cdd7e5 100644
--- a/main/openvpn/openvpn.initd
+++ b/main/openvpn/openvpn.initd
@@ -20,43 +20,20 @@ depend() {
}
checkconfig() {
- # Linux has good dynamic tun/tap creation
- if [ $(uname -s) = "Linux" ] ; then
- if [ ! -e /dev/net/tun ]; then
- if ! modprobe tun ; then
- eerror "TUN/TAP support is not available" \
- "in this kernel"
- return 1
- fi
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun; then
+ eerror "TUN/TAP support is not available" \
+ "in this kernel"
+ return 1
fi
- if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
- ebegin "Detected broken /dev/net/tun symlink, fixing..."
- rm -f /dev/net/tun
- ln -s /dev/misc/net/tun /dev/net/tun
- eend $?
- fi
- return 0
- fi
-
- # Other OS's don't, so we rely on a pre-configured interface
- # per vpn instance
- local ifname=$(sed -n -e 's/[[:space:]]*dev[[:space:]][[:space:]]*\([^[:space:]]*\).*/\1/p' "${VPNCONF}")
- if [ -z ${ifname} ] ; then
- eerror "You need to specify the interface that this openvpn" \
- "instance should use" \
- "by using the dev option in ${VPNCONF}"
- return 1
- fi
-
- if ! ifconfig "${ifname}" >/dev/null 2>/dev/null ; then
- # Try and create it
- echo > /dev/"${ifname}" >/dev/null
fi
- if ! ifconfig "${ifname}" >/dev/null 2>/dev/null ; then
- eerror "${VPNCONF} requires interface ${ifname}" \
- "but that does not exist"
- return 1
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
fi
+ return 0
}
start() {