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

View File

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