summaryrefslogtreecommitdiff
path: root/templates/interfaces/l2tpv3/node.def
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-04-12 07:36:48 -0700
committerDaniil Baturin <daniil@baturin.org>2014-04-12 07:36:48 -0700
commit65289163fce66a7d6a55a97a9510a5323d71315f (patch)
treedca66c93488fe906aac689684ecf0e1b50dd6dfe /templates/interfaces/l2tpv3/node.def
parentc8bac72d3ce7feb29d86b87947cf8ac626e843a9 (diff)
downloadvyatta-cfg-system-65289163fce66a7d6a55a97a9510a5323d71315f.tar.gz
vyatta-cfg-system-65289163fce66a7d6a55a97a9510a5323d71315f.zip
Bug #170: Set default wait time to 0.
Diffstat (limited to 'templates/interfaces/l2tpv3/node.def')
-rw-r--r--templates/interfaces/l2tpv3/node.def15
1 files changed, 9 insertions, 6 deletions
diff --git a/templates/interfaces/l2tpv3/node.def b/templates/interfaces/l2tpv3/node.def
index d609cb65..134a5c02 100644
--- a/templates/interfaces/l2tpv3/node.def
+++ b/templates/interfaces/l2tpv3/node.def
@@ -27,12 +27,15 @@ begin:
fi
create:
- for i in `seq 1 $VAR(./wait/@)`
- do
- ping -c 1 $VAR(./remote-ip/@) > /dev/null 2>&1 && break
- sleep 1
- done
- ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) ||
+ WAIT_COUNT=$VAR(./wait/@)
+ if [ $WAIT_COUNT != 0 ]; then
+ for i in `seq 1 $VAR(./wait/@)`
+ do
+ ping -c 1 $VAR(./remote-ip/@) > /dev/null 2>&1 && break
+ sleep 1
+ done
+ fi
+ ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./source-port/@) udp_dport $VAR(./destination-port/@) encap $VAR(./encapsulation/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) ||
echo "ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@)"
ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@) || echo "ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@)"