# Calling our vendor script to reconfigure routes after dhcp changes.

case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT)
    # Add routes required by the devicestack
    /vendor/bin/configure-routes.sh

    # Let the devicestack now that a DHCP config is available
    # This is important for example when the DHCP server is only available after
    # the devicestack started already. Then the device would not be found in the
    # GPA.
    . /vendor/chroot-env
    busybox chroot /gira /usr/bin/env -i $ENVIRONMENT /opt/gira/bin/dscsampleapp -r="{\"command\":\"SetDeviceConfig\",\"deviceConfig\":{\"Dhcp\":true}}"
    ;;

IPV4LL)
    ip route replace 224.0.0.0/4 dev ${interface}
    ;;
esac
