#!/bin/bash

# This file is part of DPU ZTP package.

# This script hooks into dhclient default configuration
# script dhclient-script(8) and tries to initiate 
# automated provisioning process once it received
# a special 'ZTP_PROVISION_URL' option in the DHCP lease
#

case $reason in
  BOUND|RENEW|REBIND|REBOOT)
      if [ -n "$new_ztp_provision_url" ]; then
        /usr/sbin/ztp -q "$new_ztp_provision_url"
      fi
    ;;
esac
