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"
19 for i in `seq 1 $steps`
21 ipsec statusall 2>&1 | grep ^[[:space:]]*$1: >/dev/null
22 [ $? -eq 0 ] && exit 0
26 echo "Connection '$1' not available after $secs second(s)"