1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

FreeBSD has setkey in different location from NetBSD.

Submitted by:	Mike Makonnen <makonnen@pacbell.net>
This commit is contained in:
Hajimu UMEMOTO 2002-07-31 16:39:19 +00:00
parent 3afe533f4f
commit ec2409ba60
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101085

View File

@ -24,6 +24,15 @@ stop_cmd="ipsec_stop"
reload_cmd="ipsec_reload"
extra_commands="reload"
case `${CMD_OSTYPE}` in
FreeBSD)
ipsec_program="/usr/sbin/setkey"
;;
NetBSD)
ipsec_program="/sbin/setkey"
;;
esac
ipsec_prestart()
{
if [ ! -f "$ipsec_file" ]; then
@ -45,7 +54,7 @@ ipsec_prestart()
ipsec_start()
{
echo "Installing ipsec manual keys/policies."
/sbin/setkey -f $ipsec_file
${ipsec_program} -f $ipsec_file
}
ipsec_stop()
@ -56,16 +65,16 @@ ipsec_stop()
# it is very questionable to do this during shutdown session, since
# it can hang any of remaining IPv4/v6 session.
#
/sbin/setkey -F
/sbin/setkey -FP
${ipsec_program} -F
${ipsec_program} -FP
}
ipsec_reload()
{
echo "Reloading ipsec manual keys/policies."
/sbin/setkey -F
/sbin/setkey -FP
/sbin/setkey -f "$ipsec_file"
${ipsec_program} -F
${ipsec_program} -FP
${ipsec_program} -f "$ipsec_file"
}
load_rc_config $name