3 # $NetBSD: ipsec,v 1.7 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/ipsec,v 1.5 2003/02/16 20:46:08 mtm Exp $
5 # $DragonFly: src/etc/rc.d/ipsec,v 1.3 2004/01/26 17:21:15 rob Exp $
9 # REQUIRE: root beforenetlkm mountcritlocal tty
13 # it does not really require beforenetlkm.
19 start_precmd="ipsec_prestart"
20 start_cmd="ipsec_start"
21 stop_precmd="test -f /etc/ipsec.conf"
23 reload_cmd="ipsec_reload"
24 extra_commands="reload"
25 ipsec_program="/usr/sbin/setkey"
26 # ipsec_file is set by rc.conf
30 if [ ! -f "$ipsec_file" ]; then
31 warn "$ipsec_file not readable; ipsec start aborted."
33 # If booting directly to multiuser, send SIGTERM to
34 # the parent (/etc/rc) to abort the boot
36 if [ "$autoboot" = yes ]; then
37 echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
48 echo "Installing ipsec manual keys/policies."
49 ${ipsec_program} -f $ipsec_file
54 echo "Clearing ipsec manual keys/policies."
56 # still not 100% sure if we would like to do this.
57 # it is very questionable to do this during shutdown session, since
58 # it can hang any of remaining IPv4/v6 session.
66 echo "Reloading ipsec manual keys/policies."
69 ${ipsec_program} -f "$ipsec_file"