c9cc7aea41
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
29 lines
655 B
Django/Jinja
Executable File
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 %}
|
|
|