mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-25 04:43:33 +00:00
fffceacc53
PR: ports/117128 Submitted by: John Hein <jhein@timing.com> Approved by: VANHULLEBUS Yvan <vanhu@netasq.com> (maintainer)
52 lines
1.1 KiB
Bash
52 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# Start or stop racoon
|
|
# $FreeBSD$
|
|
|
|
# PROVIDE: racoon
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# NOTE for FreeBSD 5.0+:
|
|
# If you want this script to start with the base rc scripts
|
|
# move racoon.sh to /etc/rc.d/racoon
|
|
|
|
prefix=%%PREFIX%%
|
|
|
|
# Define these racoon_* variables in one of these files:
|
|
# /etc/rc.conf
|
|
# /etc/rc.conf.local
|
|
# /etc/rc.conf.d/racoon
|
|
#
|
|
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
|
#
|
|
[ -z "$racoon_enable" ] && racoon_enable="NO" # Disable by default
|
|
#racoon_program="${prefix}/sbin/racoon" # Location of racoon
|
|
#racoon_flags="" # Flags to racoon program
|
|
racoon_create_dirs=NO # Create $required_dirs (for
|
|
# /var mfs)?
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name="racoon"
|
|
rcvar=`set_rcvar`
|
|
command="${prefix}/sbin/${name}"
|
|
pidfile="/var/run/${name}.pid"
|
|
socketfile="%%STATEDIR%%/${name}.sock"
|
|
required_files="${prefix}/etc/${name}/${name}.conf"
|
|
required_dirs="%%STATEDIR%%"
|
|
start_precmd="racoon_cleanup"
|
|
stop_postcmd="racoon_cleanup"
|
|
|
|
racoon_cleanup() {
|
|
/bin/rm -f ${pidfile}
|
|
/bin/rm -f ${socketfile}
|
|
}
|
|
|
|
load_rc_config $name
|
|
if [ "$1" = start ] && checkyesno "${name}_create_dirs"; then
|
|
/bin/mkdir -p $required_dirs
|
|
fi
|
|
run_rc_command "$1"
|