diff options
author | vd <vd@FreeBSD.org> | 2007-02-26 03:42:55 +0800 |
---|---|---|
committer | vd <vd@FreeBSD.org> | 2007-02-26 03:42:55 +0800 |
commit | c8bdeeba364f9ef3c08f6be9c47cdf0bad78f93d (patch) | |
tree | a1727efd3a2f9773180f1734e3294a1a7651bd83 /security/openvpn/files | |
parent | 47cd170f37f2ef2c17246caf900959e77c33d298 (diff) | |
download | freebsd-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.in | 12 |
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%%" |