Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Building Embedded Linux Systems

[ About Us ]
[ Home Page ]
[ Advertise ]

Firewall and Proxy Server HOWTO: APPENDEX B - An VPN RC Script for RedHat
Next Previous Contents

16. APPENDEX B - An VPN RC Script for RedHat

#!/bin/sh
#
# vpnd            This shell script takes care of starting and stopping
#                 vpnd (Vertual Privage Network connections).
#
# chkconfig: - 96 96
# description: vpnd 
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/vpnd ] || exit 0

[ -f /etc/vpnd.conf ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting vpnd: "
        daemon vpnd
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vpnd
        echo
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down vpnd: "
        killproc vpnd
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vpnd
        echo
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: vpnd {start|stop|restart}"
        exit 1
esac

exit $RETVAL


Next Previous Contents


Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Documentation Project.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.