#!/bin/sh
#
# racoon IKEv1 key management daemon
#
# chkconfig: - 15 85
# description: racoon is an IKEv1 (ISAKMP/Oakley) key management daemon
# processname: racoon
# config: /etc/racoon/racoon.conf

### BEGIN INIT INFO
# Provides: ipsec
# Required-Start: $network $syslog
# Required-Stop:
# Short-Description: IKEv1 key management daemon
# Description: racoon is an IKEv1 (ISAKMP/Oakley) key management daemon
### END INIT INFO

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

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

exec=/usr/local/racoon2/sbin/spmd
exec2=/usr/local/racoon2/sbin/iked

# See how we were called.
case "$1" in
  start)
	/usr/local/racoon2/sbin/spmd &
        sleep 1
	/usr/local/racoon2/sbin/iked &
	;;
  stop)
	killall iked
	killall spmd
	;;
  restart)
	killall iked
	killall spmd
	/usr/local/racoon2/sbin/spmd &
        sleep 1
	/usr/local/racoon2/sbin/iked &
	;;
  reload)
	;;
  force-reload)
	;;
  condrestart|try-restart)
	restart
	;;
  status)
	;;
  *)
	echo "Usage: $prog {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
	exit 2
esac
exit $?
