1 diff -Naur freeswan-1.95.orig/utils/setup freeswan-1.95/utils/setup
2 --- freeswan-1.95.orig/utils/setup Mon Feb 18 12:48:24 2002
3 +++ freeswan-1.95/utils/setup Mon Feb 18 13:45:46 2002
5 # description: IPsec provides encrypted and authenticated communications; \
6 # KLIPS is the kernel half of it, Pluto is the user-level management daemon.
8 -me='ipsec setup' # for messages
9 +# Source function library
10 +. /etc/rc.d/init.d/functions
13 +. /etc/sysconfig/network
15 +# Check that networking is up.
16 +if is_yes "${NETWORKING}"; then
17 + if [ ! -f /var/lock/subsys/network ]; then
18 + # nls "ERROR: Networking is down. %s can't be run." <service>
19 + msg_network_down <service>
28 +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
65 + if test " `id -u`" != " 0"
67 + echo "permission denied (must be superuser)" |
68 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
74 + ) 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
76 + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipsec
78 + # show "%s service is already running." ipsec
79 + msg_already_running ipsec
82 - tmp=/var/run/ipsec_setup.st
86 - ) 2>&1 | logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
92 + stop|--stop|_autostop)
94 + # show "Stopping %s service" ipsec
95 + if [ -f /var/lock/subsys/ipsec ]; then
97 + if test " `id -u`" != " 0"
99 + echo "permission denied (must be superuser)" |
100 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
104 + ipsec _realsetup $1
106 + ) 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1
107 + rm -f /var/lock/subsys/ipsec
109 + # show "%s service is not running." ipsec
110 + msg_not_running ipsec