3 # Wait until a given IPsec connection becomes available
7 # $2 - maximum time to wait in seconds, default is 5 seconds
9 if [[ $# -lt 1 || $# -gt 2 ]]
11 echo "invalid arguments"
18 cmd="swanctl --list-conns"
19 grep 'load.*stroke' /etc/strongswan.conf >/dev/null
25 for i in `seq 1 $steps`
27 $cmd 2>&1 | grep ^[[:space:]]*$1: >/dev/null
28 [ $? -eq 0 ] && exit 0
32 echo "Connection '$1' not available after $secs second(s)"