1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

- In managed mode the script does not return the proper value due to $?

is reset by the if command. Therefore, the script does not fail when
  starts with broken configuration files
- While I'm here, use %%RC_SUBR%% instead of /etc/rc.subr

PR:		ports/110320
Submitted by:	Dominic Fandrey <lon_kamikaze at gmx.de>
Approved by:	maintainer timeout (6 months)
This commit is contained in:
Rong-En Fan 2007-09-23 12:47:55 +00:00
parent f9174c9de6
commit bd519e53d3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=199984
2 changed files with 8 additions and 5 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= vpnc
PORTVERSION= 0.4.0
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= http://www.unix-ag.uni-kl.de/~massar/vpnc/

View File

@ -20,7 +20,7 @@
: ${vpnc_conf_dir="%%PREFIX%%/etc"}
: ${vpnc_record="$vpnc_pid_dir/vpnc.record"}
. /etc/rc.subr
. %%RC_SUBR%%
name="vpnc"
rcvar=`set_rcvar`
@ -43,9 +43,12 @@ vpnc_start() {
current="$vpnc_conf_dir/$config"
# Start vpnc.
if ! $command $current $vpnc_flags; then
status=$?
echo "Running 'vpnc $current $vpnc_flags' failed."
$command --local-port 0 $current $vpnc_flags
status=$?
if [ $status != 0 ]; then
# VPNC does not print a newline after an error.
echo
echo "Running 'vpnc $current --local-port 0 $vpnc_flags' failed."
return $status
fi