aboutsummaryrefslogtreecommitdiffstats
path: root/main/openvpn
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
parent733e23a8f6ea3d812ea236a983b67c8bc608f942 (diff)
downloadaports-d2e0d2c599f08f03f98ad0e59cdeb6a4f4ac294e.tar.bz2
aports-d2e0d2c599f08f03f98ad0e59cdeb6a4f4ac294e.tar.xz
main/openvpn: remove non-Linux part from init script
Diffstat (limited to 'main/openvpn')
-rw-r--r--main/openvpn/APKBUILD2
-rw-r--r--main/openvpn/openvpn.initd45
2 files changed, 12 insertions, 35 deletions
diff --git a/main/openvpn/APKBUILD b/main/openvpn/APKBUILD
index 334261e67b..f135560950 100644
--- a/main/openvpn/APKBUILD
+++ b/main/openvpn/APKBUILD
@@ -60,7 +60,7 @@ pam() {
sha512sums="cdd70bfd03177bc6cb70d0d614e40389df00816b7097740b4cda9d7bee094d1463fdb5afeaf604c52c7b3167d1edb098a2e095e131a8b9fed0ed8b29da90cbe8 openvpn-2.4.6.tar.gz
5a083cdf8216db5e6e4577c00ccfe8e03ca318935ec9daa2018a8a6d4d7fd2b04fe395d7b329f16108101d69a6c0b70690883fda2cb552db7abf2f8246cc561f libressl.patch
-8a4080b7784faa156aa0775f7b73fe5c054707270af2a3139150629450ad0f1f5954dce5fc850f1bfd7b93bcc47ed4bc9b22159c536874698c78d81ba99338a7 openvpn.initd
+9210602b74c58594efc80163fcbf1f7359dc288936215706a1edf8b192623775c4eea3b6a2593946b64dffc33477a4775225bf96bff9b12ecc102c4cdfd3ea20 openvpn.initd
982ade883afbe2e656a9cbbe36c31c0e8b4f7bbbe5b63df9f7b834f02a9153032fb7445c85d3e91f62c68a7ddd13c3afbf420fb71cdd13d9c4b69f867bdd9f37 openvpn.confd
f904d6125ed1ddb48ea632c3b290a7a4a7a7436be0d46b323fc8c92f919f9d076fdc78ff7bed0dd65675f0bc3559e531e372b805fc11ef287efeeb4d54fe52f4 openvpn.up
8f2889dc92b57deaea15970945ac8b1bacdfa660e2a74ce13acaf6f9b431823fec82cdc7d942d0bacd1f54edf727c7c240a6eb8f7d0c745bc52838535c37c901 openvpn.down"
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() {