sonic-buildimage/dockers/docker-dhcp-relay/wait_for_intf.sh.j2
Taoyu Li c9cc7aea41 [configdb] Migrate minigraph configurations to DB (#942)
Modify minigraph parser output format so it fit DB schema
Modify configuration templates to fit new schema
Systemd services dependencies are modified so database starts before any configuration consumer
2017-09-12 14:13:27 -07:00

29 lines
655 B
Django/Jinja
Executable File

#!/usr/bin/env bash
function wait_until_iface_exists
{
IFACE=$1
echo "Waiting for interface ${IFACE}..."
# Wait for the interface to come up (i.e., 'ip link show' returns 0)
until ip link show $IFACE > /dev/null 2>&1; do
sleep 1
done
echo "Interface ${IFACE} is created"
}
# Wait for all interfaces to come up before starting the DHCP relay
{% for (name, prefix) in INTERFACE %}
wait_until_iface_exists {{ name }}
{% endfor %}
{% for (name, prefix) in VLAN_INTERFACE %}
wait_until_iface_exists {{ name }}
{% endfor %}
{% for (name, prefix) in PORTCHANNEL_INTERFACE %}
wait_until_iface_exists {{ name }}
{% endfor %}