aboutsummaryrefslogtreecommitdiffstats
path: root/security/openvpn/files
diff options
context:
space:
mode:
authorvd <vd@FreeBSD.org>2007-02-26 03:42:55 +0800
committervd <vd@FreeBSD.org>2007-02-26 03:42:55 +0800
commitc8bdeeba364f9ef3c08f6be9c47cdf0bad78f93d (patch)
treea1727efd3a2f9773180f1734e3294a1a7651bd83 /security/openvpn/files
parent47cd170f37f2ef2c17246caf900959e77c33d298 (diff)
downloadfreebsd-ports-gnome-c8bdeeba364f9ef3c08f6be9c47cdf0bad78f93d.tar.gz
freebsd-ports-gnome-c8bdeeba364f9ef3c08f6be9c47cdf0bad78f93d.tar.zst
freebsd-ports-gnome-c8bdeeba364f9ef3c08f6be9c47cdf0bad78f93d.zip
Fix a bug I introduced with last commit which resulted in openvpn not
being started during boot. The reason for this is that at boot $0 is not /usr/local/etc/rc.d/openvpn but /etc/rc. The fix is a bit hackish because it retrieves the script name from $_file - variable used in run_rc_script(). Reported by: bazzoola <bazzoola@gmail.com>
Diffstat (limited to 'security/openvpn/files')
-rw-r--r--security/openvpn/files/openvpn.sh.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/security/openvpn/files/openvpn.sh.in b/security/openvpn/files/openvpn.sh.in
index 92e1d704695c..54b710c47626 100644
--- a/security/openvpn/files/openvpn.sh.in
+++ b/security/openvpn/files/openvpn.sh.in
@@ -63,7 +63,17 @@
. %%RC_SUBR%%
-name=$(basename "$0")
+case "$0" in
+ /etc/rc*)
+ # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),
+ # so get the name of the script from $_file
+ name=$(basename "$_file")
+ ;;
+ *)
+ name=$(basename "$0")
+ ;;
+esac
+
rcvar=`set_rcvar`
prefix="%%PREFIX%%"