]> git.pld-linux.org Git - packages/cisco-vpnclient.git/commitdiff
- from source, need pldify
authorspeedy <speedy@pld-linux.org>
Sat, 12 Mar 2005 21:56:27 +0000 (21:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cisco_vpnclient.init -> 1.1

cisco_vpnclient.init [new file with mode: 0644]

diff --git a/cisco_vpnclient.init b/cisco_vpnclient.init
new file mode 100644 (file)
index 0000000..95c4f21
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+##########################################################################
+#           Copyright (c) 2001, Cisco Systems, All Rights Reserved
+###########################################################################
+#
+#  File:    vpnclient_init
+#  Date:    04/23/2001
+#
+###########################################################################
+#
+# chkconfig: 345 85 85
+# description: Startup script for the vpn client. Version 4.6.00 (0045)
+#
+###########################################################################
+# Source function library.
+VPNCLIENT="/opt/cisco-vpnclient/bin/vpnclient"
+VPNDEV="cipsec0"
+VPNMOD=cisco_ipsec
+case `uname -r` in
+2.[56].*)
+    VPNMOD_FILE="${VPNMOD}.ko"
+    ;;
+*)
+    VPNMOD_FILE="$VPNMOD"
+    ;;
+esac    
+
+WHOAMI=`id | sed -e 's/(.*//'`
+
+# See how we were called.
+case "$1" in
+  start)
+       echo -n "Starting ${VPNCLIENT}: "
+       if [ "$WHOAMI" != "uid=0" ] ; then
+               echo "Failed (super user access required)"
+               exit 1
+       fi
+       /sbin/lsmod | grep -q "${VPNMOD}"
+        if [ "$?" = "0" ] ; then 
+               echo "module ${VPNMOD} is already running. Use restart instead."
+               exit 1
+       fi
+
+       if [ -f /etc/resolv.conf.vpnbackup ]; then
+               echo "restoring /etc/resolv.conf"
+               mv /etc/resolv.conf.vpnbackup /etc/resolv.conf
+       fi
+       if [ -d /lib/modules/preferred ]; then
+               PC=/lib/modules/preferred/CiscoVPN
+       else
+               PC=/lib/modules/`uname -r`/CiscoVPN
+       fi
+       if [ -d $PC ] ; then
+               /sbin/insmod ${PC}/${VPNMOD_FILE}
+               if [ "$?" != "0" ] ; then
+                       echo "Failed (insmod)"
+               exit 1
+        fi
+       else
+               echo "module directory $PC not found."
+               exit 1
+       fi
+       case "`uname -r`" in
+       2.6.*)
+               ;;
+       2.5.*)
+               ;;
+       2.4.*)
+               ;;
+       2.2.*)
+               ;;
+       2.0.*)
+               #
+               # This is only needed due to a bug in 2.0.x kernels that affects
+               # arp lookups.
+               #
+               ifconfig $VPNDEV 222.222.222.222 ;
+               if [ "$?" != "0" ] ; then
+                       echo "Failed (ifconfig)"
+                       /sbin/rmmod ${VPNMOD}
+                       exit 1
+               fi
+               ;;
+       *)
+               echo "Failed (unsupported Linux version)"
+               /sbin/rmmod ${VPNMOD}
+               exit 1
+               ;;
+       esac
+       
+       echo "Done"
+       ;;
+  stop)
+       echo -n "Shutting down ${VPNCLIENT}: "
+       if [ "$WHOAMI" != "uid=0" ] ; then
+               echo "Failed (super user access required)"
+               exit 1
+       fi
+    killall cvpnd > /dev/null 2>&1
+
+       /sbin/lsmod | grep -q "${VPNMOD}"
+    if [ "$?" != "0" ] ; then 
+               echo "module ${VPNMOD} is not running."
+               exit 1
+       fi
+       /sbin/ifconfig $VPNDEV down
+       if [ "$?" != "0" ] ; then
+               echo "Failed (ifconfig)"
+               exit 1
+       fi
+       /sbin/rmmod ${VPNMOD}
+       if [ "$?" != "0" ] ; then
+               echo "Failed (rmmod)"
+               exit 1
+       fi
+       echo "Done"
+       ;;
+  status)
+       /sbin/lsmod | egrep 'Module'
+       /sbin/lsmod | egrep "${VPNMOD}"
+       if [ "$?" != "0" ] ; then
+                       echo
+                       echo "Status Failed (lsmod ${VPNMOD}) - The VPN module is not loaded."
+    fi
+       echo
+       /sbin/ifconfig $VPNDEV
+       if [ "$?" != "0" ] ; then
+               echo
+               echo "Status Failed (ifconfig ${VPNDEV}) - The virtual interface is not present."
+               exit 1
+       fi
+       ;;
+  restart|reload)
+       $0 stop
+       $0 start
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|reload|status}"
+       exit 1
+esac
+
+exit 0
This page took 0.100331 seconds and 4 git commands to generate.