testing/guestbin/wait-until-policy-loaded
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | # Wait until --listen succeeds, and then look for trap route |
| 4 | # caused by "packetdefault" |
| 5 | # This will delay until pluto is started |
| 6 | |
| 7 | count=20 |
| 8 | until [ $count -eq 0 ] || ipsec whack --listen >/dev/null 2>&1 |
| 9 | do |
| 10 | count=`expr $count - 1` |
| 11 | sleep 2 |
| 12 | done |
| 13 | |
| 14 | until [ $count -eq 0 ] || (ipsec eroute | grep 0.0.0.0/0 > /dev/null) |
| 15 | do |
| 16 | count=`expr $count - 1` |
| 17 | sleep 1 |
| 18 | done |
| 19 | |
| 20 |