mirror of
https://git.freebsd.org/ports.git
synced 2025-05-31 18:36:28 -04:00
Streamline a bit:
- remove subshell to use basename, and use ## substitution [1] - remove FreeBSD 5.X compatibility comment [1] - remove FreeBSD 5.X compatibility code The parts marked with [1] above were Submitted by: dougb (Doug Barton)
This commit is contained in:
parent
9e17859c5a
commit
f9b85c98f1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=267508
3 changed files with 13 additions and 20 deletions
|
@ -85,6 +85,7 @@ post-build:
|
|||
cd ${WRKSRC}/plugin/auth-pam && ${CC} ${CPPFLAGS} -I../.. -DDLOPEN_PAM=0 ${CFLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.c pamdl.c -lc -lpam
|
||||
@# self-tests here
|
||||
.if !defined(WITHOUT_CHECK)
|
||||
@${ECHO} ; ${ECHO} "### Note that you can skip these lengthy selftests with WITHOUT_CHECK=yes ###" ; ${ECHO}
|
||||
cd ${WRKSRC} && ${MAKE} check
|
||||
.endif
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# This script supports running multiple instances of openvpn.
|
||||
# To run additional instance link this script to something like
|
||||
# To run additional instances link this script to something like
|
||||
# % ln -s openvpn openvpn_foo
|
||||
# and define additional openvpn_foo_* variables in one of
|
||||
# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo
|
||||
|
@ -67,23 +67,21 @@ 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" .sh)
|
||||
name="$_file"
|
||||
;;
|
||||
*)
|
||||
name=$(basename "$0" .sh)
|
||||
name="$0"
|
||||
;;
|
||||
esac
|
||||
|
||||
name="${name##*/}"
|
||||
|
||||
rcvar=$(set_rcvar)
|
||||
|
||||
openvpn_precmd()
|
||||
{
|
||||
for i in $interfaces ; do
|
||||
# FreeBSD <= 5.4 does not know kldstat's -m option
|
||||
# FreeBSD >= 6.0 does not add debug.* sysctl information
|
||||
# in the default build - we check both to keep things simple
|
||||
if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 \
|
||||
&& ! kldstat -m if_${i} >/dev/null 2>&1 ; then
|
||||
if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 ; then
|
||||
if ! kldload if_${i} ; then
|
||||
warn "Could not load $i module."
|
||||
return 1
|
||||
|
@ -123,8 +121,6 @@ stop_postcmd="stop_postcmd"
|
|||
load_rc_config ${name}
|
||||
|
||||
eval ": \${${name}_enable:=\"NO\"}"
|
||||
eval ": \${${name}_flags:=\"\"}"
|
||||
eval ": \${${name}_if:=\"\"}"
|
||||
eval ": \${${name}_configfile:=\"%%PREFIX%%/etc/openvpn/${name}.conf\"}"
|
||||
eval ": \${${name}_dir:=\"%%PREFIX%%/etc/openvpn\"}"
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# This script supports running multiple instances of openvpn.
|
||||
# To run additional instance link this script to something like
|
||||
# To run additional instances link this script to something like
|
||||
# % ln -s openvpn openvpn_foo
|
||||
# and define additional openvpn_foo_* variables in one of
|
||||
# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo
|
||||
|
@ -66,23 +66,21 @@ 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" .sh)
|
||||
name="$_file"
|
||||
;;
|
||||
*)
|
||||
name=$(basename "$0" .sh)
|
||||
name="$0"
|
||||
;;
|
||||
esac
|
||||
|
||||
name="${name##*/}"
|
||||
|
||||
rcvar=$(set_rcvar)
|
||||
|
||||
openvpn_precmd()
|
||||
{
|
||||
for i in $interfaces ; do
|
||||
# FreeBSD <= 5.4 does not know kldstat's -m option
|
||||
# FreeBSD >= 6.0 does not add debug.* sysctl information
|
||||
# in the default build - we check both to keep things simple
|
||||
if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 \
|
||||
&& ! kldstat -m if_${i} >/dev/null 2>&1 ; then
|
||||
if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 ; then
|
||||
if ! kldload if_${i} ; then
|
||||
warn "Could not load $i module."
|
||||
return 1
|
||||
|
@ -114,8 +112,6 @@ stop_postcmd="stop_postcmd"
|
|||
load_rc_config ${name}
|
||||
|
||||
eval ": \${${name}_enable:=\"NO\"}"
|
||||
eval ": \${${name}_flags:=\"\"}"
|
||||
eval ": \${${name}_if:=\"\"}"
|
||||
eval ": \${${name}_configfile:=\"%%PREFIX%%/etc/openvpn/${name}.conf\"}"
|
||||
eval ": \${${name}_dir:=\"%%PREFIX%%/etc/openvpn\"}"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue