No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / ipsec-tools / rpm / ipsec-tools.FC1
blobf4573e098900151094bd7ce915575155232081c8
1 #!/bin/sh
3 # chkconfig: 2345 08 92
4 # description: Starts and stops racoon and loads IPSec SPD's
6 # config: /etc/sysconfig/ipsec.spd
7 # config: /etc/racoon/racoon.conf
9 # Contributed by Kimmo Koivisto <kimmo.koivisto@surfeu.fi>
10 # Tested with Fedora C1
12 # Source function library.
13 . /etc/init.d/functions
15 RACOON=/usr/sbin/racoon
16 SETKEY=/sbin/setkey
17 IPSEC_SPD=/etc/sysconfig/ipsec.spd
18 VAR_SUBSYS_IPSEC=/var/lock/subsys/ipsec
20 if [ ! -x /usr/sbin/$RACOON ]; then
21 echo -n $"/usr/sbin/$RACOON does not exist."; warning; echo
22 exit 0
26 start() {
28 # Check that SPD-file exists and load it.
29 if [ -f "$IPSEC_SPD" ]; then
30 $SETKEY -f $IPSEC_SPD
32 $RACOON
33 touch $VAR_SUBSYS_IPSEC
37 stop() {
38 killall $RACOON 2> /dev/null
39 $SETKEY -FD
40 $SETKEY -FP
41 rm -f $VAR_SUBSYS_IPSEC
44 status() {
45 # Do not print status if lockfile is missing
47 if [ ! -f "$VAR_SUBSYS_IPSEC" ]; then
48 echo $"IPSec is stopped."
49 return 1
52 if [ -f "$VAR_SUBSYS_IPSEC" ]; then
53 echo $"IPSec is started."
54 return 0
58 restart() {
59 stop
60 start
65 case "$1" in
66 start)
67 start
69 stop)
70 stop
72 restart)
73 restart
75 condrestart)
76 [ -e "$VAR_SUBSYS_IPSEC" ] && restart
78 status)
79 status
82 echo $"Usage: $0 {start|stop|restart|condrestart|status}"
83 exit 1
85 esac
87 exit 0