sonic-buildimage/files/dhcp/sethostname6
rajendra-dendukuri fec80293dd ZTP infrastructure changes to support DHCP discovery provisioning data (#3298)
* ZTP infrastructure changes to support DHCP discovery provisioning data

- Dynamically generate DHCP client configuration based on current ZTP state
- Added support to request and process hostname when using DHCPv6
- Do not process graphservice url dhcp option if ZTP is enabled, ZTP service
will process it
- Generate /e/n/i file with all active interfaces seeking address assignment
via DHCP. Only interfaces that are created in Linux will be added to /e/n/i.
Also DHCP is started only on linked up in-band interfaces.

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
2019-12-10 08:16:56 -08:00

15 lines
524 B
Plaintext

case $reason in
BOUND6|RENEW6|REBIND6|REBOOT)
current_dhcp6_fqdn=`hostname`
if [ "$current_dhcp6_fqdn" != "$new_dhcp6_fqdn" ] && [ -n "$new_dhcp6_fqdn" ]
then
echo $new_dhcp6_fqdn > /etc/hostname
hostname -F /etc/hostname
sed -i "/\s$current_dhcp6_fqdn$/d" /etc/hosts
sed -i "/\s$new_dhcp6_fqdn$/d" /etc/hosts
echo "127.0.0.1 $new_dhcp6_fqdn" >> /etc/hosts
echo ":: $new_dhcp6_fqdn" >> /etc/hosts
fi
;;
esac