1 --- freeswan-1.97/utils/setup Wed Jun 20 17:55:13 2001
2 +++ freeswan-1.97/utils/setup.org Wed May 1 18:38:35 2002
4 # description: IPsec provides encrypted and authenticated communications; \
5 # KLIPS is the kernel half of it, Pluto is the user-level management daemon.
7 -me='ipsec setup' # for messages
8 +# Source function library
9 +. /etc/rc.d/init.d/functions
12 +. /etc/sysconfig/network
14 +# Check that networking is up.
15 +if is_yes "${NETWORKING}"; then
16 + if [ ! -f /var/lock/subsys/network ]; then
17 + # nls "ERROR: Networking is down. %s can't be run." ipsec
18 + msg_network_down ipsec
27 +me='ipsec setup' # for messages
30 if test " $IPSEC_DIR" = " " # if we were not called by the ipsec command
32 # we must establish a suitable PATH ourselves
36 echo "cannot find ipsec command -- \`$1' aborted" |
37 - logger -s -p daemon.error -t ipsec_setup
38 + logger -p daemon.error -t ipsec_setup
43 if test " $IPSEC_confreadstatus" != " "
45 echo "$IPSEC_confreadstatus -- \`$1' aborted" |
46 - logger -s -p daemon.error -t ipsec_setup
47 + logger -p daemon.error -t ipsec_setup
50 IPSECsyslog=${IPSECsyslog-daemon.error}
55 - start|--start|stop|--stop|_autostop|_autostart)
56 - if test " `id -u`" != " 0"
58 - echo "permission denied (must be superuser)" |
59 - logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
60 + start|--start|_autostart)
61 + # Check if the service is already running?
62 + if [ ! -f /var/lock/subsys/ipsec ]; then
63 + # show "Starting %s service" ipsec
66 + if test " `id -u`" != " 0"
68 + echo "permission denied (must be superuser)" |
69 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
74 + ipsec _realsetup $1 ;
76 + } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
78 + if [ "$RETVAL" -eq 0 ];
80 + touch /var/lock/subsys/ipsec
88 + # show "%s service is already running." ipsec
89 + msg_already_running ipsec
93 - tmp=/var/run/ipsec_setup.st
97 - ) 2>&1 | logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
104 + stop|--stop|_autostop)
106 + # show "Stopping %s service" ipsec
107 + if [ -f /var/lock/subsys/ipsec ]; then
110 + if test " `id -u`" != " 0"
112 + echo "permission denied (must be superuser)" |
113 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
118 + ipsec _realsetup $1 ;
120 + } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
122 + rm -f /var/lock/subsys/ipsec
124 + if [ "$RETVAL" -eq 0 ];
132 + # show "%s service is not running." ipsec
133 + msg_not_running ipsec