#!/sbin/openrc-run

extra_started_commands="fullstatus"

depend() {
	need net
	after firewall
	provide ipsec
}

start() {
	ebegin "Starting StrongSwan"
	ipsec start
	eend $?
}

stop () {
	ebegin "Stopping StrongSwan"
	ipsec stop
	eend $?
}

restart() {
	ebegin "Restarting StrongSwan"
	svc_stop
	sleep 2
	svc_start
	eend $?
}

fullstatus() {
	ebegin "StrongSwan Status (verbose):"
	ipsec statusall
	eend $?
}