#!/bin/sh

# Wait until --listen succeeds.
# This will delay until pluto is started

count=10
until [ $count -eq 0 ] || ipsec whack --impair none >/dev/null 2>&1
do
	count=$(expr $count - 1)
	sleep 1
done

# what took so long?
if [ $count -eq 0 ]
then
	systemctl --full status ipsec.service
fi
