diff options
| author | William Hubbs <w.d.hubbs@gmail.com> | 2014-12-03 10:13:41 -0600 |
|---|---|---|
| committer | William Hubbs <w.d.hubbs@gmail.com> | 2014-12-03 10:13:41 -0600 |
| commit | 1267025fb76af18e31b2c7de16606abbb9b87ea3 (patch) | |
| tree | 8cc3a36b1dd7e1438d05a293cae8eac572126a7c /init.d.misc/openvpn.in | |
| parent | 30cc3cdb76a66c7c0f89a52db4e5cff77b570e31 (diff) | |
initial commitorigin/gh-pagesgithub/gh-pages
Diffstat (limited to 'init.d.misc/openvpn.in')
| -rw-r--r-- | init.d.misc/openvpn.in | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/init.d.misc/openvpn.in b/init.d.misc/openvpn.in deleted file mode 100644 index 32379466..00000000 --- a/init.d.misc/openvpn.in +++ /dev/null @@ -1,67 +0,0 @@ -#!@SBINDIR@/openrc-run -# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> -# Released under the 2-clause BSD license. - -vpn=${RC_SVCNAME#*.} -name="OpenVPN" -[ "$vpn" != openvpn ] && name="$name ($vpn)" -command=@PKG_PREFIX@/sbin/openvpn - -pidfile=@VARBASE@/run/"$RC_SVCNAME".pid -: ${openvpn_dir:=@PKG_PREFIX@/etc/openvpn} -: ${openvpn_config:=$openvpn_dir/$vpn.conf} -command_args="$openvpn_args --daemon --config $openvpn_config" -command_args="$command_args --writepid $pidfile" -required_dirs=$openvpn_dir -required_files=$openvpn_config - -# If we're an openvpn client, then supply a nice default config -# You can find sample up/down scripts in the OpenRC support/openvpn dir -if yesno $openvpn_client; then - : ${openvpn_up:=${openvpn_dir}/up.sh} - : ${openvpn_down:=${openvpn_dir}/down.sh} - command_args="$command_args --nobind --up-delay --up-restart --down-pre" - command_args="$command_args --up $openvpn_up" - command_args="$command_args --down $openvpn_down" - required_files="$required_files $openvpn_up $openvpn_down" - - in_background_fake="start stop" - start_inactive=YES -fi - -depend() -{ - need localmount net - use dns - after bootmisc -} - -start_pre() -{ - # Linux has good dynamic tun/tap creation - if [ "$RC_UNAME" = 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 - fi - if [ -h /dev/net/tun -a -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 - else - if command -v kldload >/dev/null 2>&1; then - # Hammer the modules home by default - sysctl -a | grep -q '\.tun\.' || kldload if_tun - sysctl -a | grep -q '\.tap\.' || kldload if_tap - fi - fi - - # If the config file does not specify the cd option, we do - if ! grep -q "^[ \t]*cd[ \t].*" "$openvpn_config"; then - command_args="$command_args --cd $openvpn_dir" - fi -} |
