X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=freeswan-init.patch;h=6245adde76070251923b09d39a13b4d82c4e7933;hb=9ba323296243f468d81fc8a13df86b9286e27f74;hp=9d9e481f68983cb568dddba63e0655c4d37bb145;hpb=b2b3c8f7ba51985f78c81817310faf8ae4208c07;p=packages%2Ffreeswan.git diff --git a/freeswan-init.patch b/freeswan-init.patch index 9d9e481..6245add 100644 --- a/freeswan-init.patch +++ b/freeswan-init.patch @@ -1,7 +1,6 @@ -diff -Naur freeswan-1.95.orig/utils/setup freeswan-1.95/utils/setup ---- freeswan-1.95.orig/utils/setup Mon Feb 18 12:48:24 2002 -+++ freeswan-1.95/utils/setup Mon Feb 18 13:45:46 2002 -@@ -30,10 +30,27 @@ +--- freeswan-1.97/utils/setup Wed Jun 20 17:55:13 2001 ++++ freeswan-1.97/utils/setup.org Thu May 2 12:08:39 2002 +@@ -30,7 +30,25 @@ # description: IPsec provides encrypted and authenticated communications; \ # KLIPS is the kernel half of it, Pluto is the user-level management daemon. @@ -14,41 +13,39 @@ diff -Naur freeswan-1.95.orig/utils/setup freeswan-1.95/utils/setup + +# Check that networking is up. +if is_yes "${NETWORKING}"; then -+ if [ ! -f /var/lock/subsys/network ]; then -+ # nls "ERROR: Networking is down. %s can't be run." -+ msg_network_down -+ exit 1 -+ fi ++ if [ ! -f /var/lock/subsys/network ]; then ++ # nls "ERROR: Networking is down. %s can't be run." ipsec ++ msg_network_down ipsec ++ exit 1 ++ fi +else -+ exit 0 ++ exit 0 +fi ++ ++me='ipsec setup' # for messages ++ -+me='ipsec setup' # for messages -+ - if test " $IPSEC_DIR" = " " # if we were not called by the ipsec command - then - # we must establish a suitable PATH ourselves -@@ -54,7 +71,7 @@ +@@ -54,7 +72,7 @@ if ! test "$found" then echo "cannot find ipsec command -- \`$1' aborted" | - logger -s -p daemon.error -t ipsec_setup -+ logger -p daemon.error -t ipsec_setup ++ logger -p daemon.error -t ipsec_setup exit 1 fi -@@ -65,7 +82,7 @@ +@@ -65,7 +83,7 @@ if test " $IPSEC_confreadstatus" != " " then echo "$IPSEC_confreadstatus -- \`$1' aborted" | - logger -s -p daemon.error -t ipsec_setup -+ logger -p daemon.error -t ipsec_setup ++ logger -p daemon.error -t ipsec_setup exit 1 fi IPSECsyslog=${IPSECsyslog-daemon.error} -@@ -78,21 +95,51 @@ +@@ -78,23 +96,79 @@ # do it case "$1" in @@ -57,27 +54,41 @@ diff -Naur freeswan-1.95.orig/utils/setup freeswan-1.95/utils/setup - then - echo "permission denied (must be superuser)" | - logger -s -p $IPSECsyslog -t ipsec_setup 2>&1 -+ start|--start|_autostart) -+ # Check if the service is already running? -+ if [ ! -f /var/lock/subsys/ipsec ]; then -+ # show "Starting %s service" ipsec -+ msg_starting ipsec -+ if test " `id -u`" != " 0" -+ then -+ echo "permission denied (must be superuser)" | -+ logger -p $IPSECsyslog -t ipsec_setup 2>&1 -+ exit 1 -+ fi -+ ( -+ ipsec _realsetup $1 -+ RETVAL=$? -+ ) 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1 -+ RETVAL=$? -+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipsec -+ else -+ # show "%s service is already running." ipsec -+ msg_already_running ipsec - exit 1 +- exit 1 ++ start|--start|_autostart) ++ # Check if the service is already running? ++ if [ ! -f /var/lock/subsys/ipsec ]; then ++ # show "Starting %s service" ipsec ++ msg_starting ipsec ++ busy ++ if test " `id -u`" != " 0" ++ then ++ echo "permission denied (must be superuser)" | ++ logger -p $IPSECsyslog -t ipsec_setup 2>&1 ++ fail ++ exit 1 ++ fi ++ { ++ ipsec _realsetup $1 ; ++ RETVAL=$?; ++ } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1 ++ ++ if [ "$RETVAL" -eq 0 ]; ++ then ++ touch /var/lock/subsys/ipsec ++ ok ++ exit $RETVAL; ++ fi ++ fail ++ exit $RETVAL ++ ++ else ++ # show "%s service is already running." ipsec ++ msg_already_running ipsec ++ ++ ++ ++ exit 1 fi - tmp=/var/run/ipsec_setup.st - ( @@ -87,29 +98,45 @@ diff -Naur freeswan-1.95.orig/utils/setup freeswan-1.95/utils/setup - st=`cat $tmp` - rm -f $tmp - exit $st -+ ;; -+ -+ stop|--stop|_autostop) -+ # Stop daemons. -+ # show "Stopping %s service" ipsec -+ if [ -f /var/lock/subsys/ipsec ]; then -+ msg_stopping ipsec -+ if test " `id -u`" != " 0" -+ then -+ echo "permission denied (must be superuser)" | -+ logger -p $IPSECsyslog -t ipsec_setup 2>&1 -+ exit 1 -+ fi -+ ( -+ ipsec _realsetup $1 -+ RETVAL=$? -+ ) 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1 -+ rm -f /var/lock/subsys/ipsec -+ else -+ # show "%s service is not running." ipsec -+ msg_not_running ipsec -+ exit 1 -+ fi ;; - +- ++ stop|--stop|_autostop) ++ # Stop daemons. ++ # show "Stopping %s service" ipsec ++ if [ -f /var/lock/subsys/ipsec ]; then ++ msg_stopping ipsec ++ busy ++ if test " `id -u`" != " 0" ++ then ++ echo "permission denied (must be superuser)" | ++ logger -p $IPSECsyslog -t ipsec_setup 2>&1 ++ fail ++ exit 1 ++ fi ++ { ++ ipsec _realsetup $1 ; ++ RETVAL=$?; ++ } 2>&1 | logger -p $IPSECsyslog -t ipsec_setup 2>&1 ++ ++ rm -f /var/lock/subsys/ipsec ++ ++ if [ "$RETVAL" -eq 0 ]; ++ then ++ ok ++ exit $RETVAL; ++ fi ++ fail ++ exit $RETVAL ++ else ++ # show "%s service is not running." ipsec ++ msg_not_running ipsec ++ exit 1 ++ fi ++ ;; ++ ++ ++ ++ restart|--restart) + $0 stop + $0 start