2 ##########################################################################
3 # Copyright (c) 2001, Cisco Systems, All Rights Reserved
4 ###########################################################################
9 ###########################################################################
11 # chkconfig: 345 85 85
12 # description: Startup script for the vpn client. Version 4.6.00 (0045)
14 ###########################################################################
15 # Source function library.
16 VPNCLIENT="/opt/cisco-vpnclient/bin/vpnclient"
19 WHOAMI=`id | sed -e 's/(.*//'`
21 # See how we were called.
24 echo -n "Starting ${VPNCLIENT}: "
25 if [ "$WHOAMI" != "uid=0" ] ; then
26 echo "Failed (super user access required)"
29 /sbin/lsmod | grep -q "${VPNMOD}"
30 if [ "$?" = "0" ] ; then
31 echo "module ${VPNMOD} is already running. Use restart instead."
35 if [ -f /etc/resolv.conf.vpnbackup ]; then
36 echo "restoring /etc/resolv.conf"
37 mv /etc/resolv.conf.vpnbackup /etc/resolv.conf
39 /sbin/modprobe ${VPNMOD}
40 if [ "$?" != "0" ] ; then
41 echo "Failed (insmod)"
55 # This is only needed due to a bug in 2.0.x kernels that affects
58 ifconfig $VPNDEV 222.222.222.222 ;
59 if [ "$?" != "0" ] ; then
60 echo "Failed (ifconfig)"
66 echo "Failed (unsupported Linux version)"
74 echo -n "Shutting down ${VPNCLIENT}: "
75 if [ "$WHOAMI" != "uid=0" ] ; then
76 echo "Failed (super user access required)"
79 killall cvpnd > /dev/null 2>&1
81 /sbin/lsmod | grep -q "${VPNMOD}"
82 if [ "$?" != "0" ] ; then
83 echo "module ${VPNMOD} is not running."
86 /sbin/ifconfig $VPNDEV down
87 if [ "$?" != "0" ] ; then
88 echo "Failed (ifconfig)"
92 if [ "$?" != "0" ] ; then
99 /sbin/lsmod | egrep 'Module'
100 /sbin/lsmod | egrep "${VPNMOD}"
101 if [ "$?" != "0" ] ; then
103 echo "Status Failed (lsmod ${VPNMOD}) - The VPN module is not loaded."
106 /sbin/ifconfig $VPNDEV
107 if [ "$?" != "0" ] ; then
109 echo "Status Failed (ifconfig ${VPNDEV}) - The virtual interface is not present."
118 echo "Usage: $0 {start|stop|restart|reload|status}"