1 --- freeswan-2.00-rc2/programs/setup/setup.in.org Mon Mar 24 14:51:14 2003
2 +++ freeswan-2.00-rc2/programs/setup/setup.in Mon Mar 24 15:19:32 2003
4 # description: IPsec provides encrypted and authenticated communications; \
5 # KLIPS is the kernel half of it, Pluto is the user-level management daemon.
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
31 echo "cannot find ipsec command -- \`$1' aborted" |
32 - logger -s -p daemon.error -t ipsec_setup
33 + logger -p daemon.error -t ipsec_setup
38 if test " $IPSEC_confreadstatus" != " "
40 echo "$IPSEC_confreadstatus -- \`$1' aborted" |
41 - logger -s -p daemon.error -t ipsec_setup
42 + logger -p daemon.error -t ipsec_setup
50 - start|--start|stop|--stop|_autostop|_autostart)
51 - if test " `id -u`" != " 0"
53 - echo "permission denied (must be superuser)" |
54 - logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
57 - tmp=/var/run/ipsec_setup.st
61 - ) 2>&1 | logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
67 + start|--start|_autostart)
68 + # Check if the service is already running?
69 + if [ ! -f /var/lock/subsys/ipsec ]; then
70 + # show "Starting %s service" ipsec
73 + if test " `id -u`" != " 0"
75 + echo "permission denied (must be superuser)" |
76 + logger -p $IPSECsyslog -t ipsec_setup 2>&1
81 + ipsec _realsetup $1 ;
83 + } | logger -p $IPSECsyslog -t ipsec_setup 2>&1
85 + if [ "$RETVAL" -eq 0 ];
87 + touch /var/lock/subsys/ipsec
95 + # show "%s service is already running." ipsec
96 + msg_already_running ipsec
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
141 $0 $IPSEC_setupflags stop