#!/bin/sh

start() {
    if [ -f /etc/ipsec-tools.conf ]; then   
        logger -s -p "user.info" -t "$0" "IPSec: initial setkey configuration"
        /usr/sbin/setkey -f /etc/ipsec-tool.conf
    else
        logger -s -p "user.info" -t "$0" "IPSec: no configuration for setkey"
    fi
}

stop() {
    busybox killall -9 setkey
}

restart() {
	stop
	start
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart|reload)
  	restart
	;;
  *)
	echo $"Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?
