Skip to content

Instantly share code, notes, and snippets.

@glidenote
Created April 5, 2012 03:18
Show Gist options
  • Save glidenote/2307698 to your computer and use it in GitHub Desktop.
Save glidenote/2307698 to your computer and use it in GitHub Desktop.
/etc/rc.d/init.d/utvpnclient
#!/bin/sh
/sbin/ifconfig utvpn_vpn 192.168.100.60 netmask 255.255.255.0
#!/bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $local_fs $remote_fs $network
# X-UnitedLinux-Should-Start: $named $time
# Required-Stop: $local_fs $remote_fs $network
# X-UnitedLinux-Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: UT-VPN Client
# Description: Start the utvpnclient daemon UT-VPN Client
# chkconfig: 2345 99 30
### END INIT INFO
DAEMON=/usr/bin/utvpnclient
LOCK=/var/lock/subsys/utvpnclient
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
sleep 3
/root/bin/add_route.sh
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$0 stop
sleep 3 # Adjust according to your env
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment