1 --- freeswan-1.97/utils/setup Wed Jun 20 17:55:13 2001
2 +++ freeswan-1.97/utils/setup.org Thu May 2 12:08:39 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
25 +me='ipsec setup' # for messages
33 echo "cannot find ipsec command -- \`$1' aborted" |
34 - logger -s -p daemon.error -t ipsec_setup
35 + logger -p daemon.error -t ipsec_setup
40 if test " $IPSEC_confreadstatus" != " "
42 echo "$IPSEC_confreadstatus -- \`$1' aborted" |
43 - logger -s -p daemon.error -t ipsec_setup
44 + logger -p daemon.error -t ipsec_setup
47 IPSECsyslog=${IPSECsyslog-daemon.error}
52 - start|--start|stop|--stop|_autostop|_autostart)
53 - if test " `id -u`" != " 0"
55 - echo "permission denied (must be superuser)" |
56 - logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
58 + start|--start|_autostart)
59 + # Check if the service is already running?
60 + if [ ! -f /var/lock/subsys/ipsec ]; then
61 + # show "Starting %s service" ipsec
64 + if test " `id -u`" != " 0"
66 + echo "permission denied (must be superuser)" |
67 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
72 + ipsec _realsetup $1 ;
74 + } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
76 + if [ "$RETVAL" -eq 0 ];
78 + touch /var/lock/subsys/ipsec
86 + # show "%s service is already running." ipsec
87 + msg_already_running ipsec
93 - tmp=/var/run/ipsec_setup.st
97 - ) 2>&1 | logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
103 + stop|--stop|_autostop)
105 + # show "Stopping %s service" ipsec
106 + if [ -f /var/lock/subsys/ipsec ]; then
109 + if test " `id -u`" != " 0"
111 + echo "permission denied (must be superuser)" |
112 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
117 + ipsec _realsetup $1 ;
119 + } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
121 + rm -f /var/lock/subsys/ipsec
123 + if [ "$RETVAL" -eq 0 ];
131 + # show "%s service is not running." ipsec
132 + msg_not_running ipsec