diff --git a/build_debian.sh b/build_debian.sh index 11d8217ff8bf..88e60e4e648a 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -239,7 +239,8 @@ allow-hotplug eth0 iface eth0 inet dhcp EOF -sudo cp files/dhcp/rfc3442-classless-routes $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks.d +sudo cp files/dhcp/hostname $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks.d/ +sudo cp files/dhcp/rfc3442-classless-routes $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks.d/ if [ -f sonic_debian_extension.sh ]; then ./sonic_debian_extension.sh $FILESYSTEM_ROOT diff --git a/files/dhcp/hostname b/files/dhcp/hostname new file mode 100644 index 000000000000..b8e924e4ceec --- /dev/null +++ b/files/dhcp/hostname @@ -0,0 +1,6 @@ +case $reason in + BOUND|RENEW|REBIND|REBOOT) + current_hostname=`hostname` + echo $current_hostname > /etc/hostname + ;; +esac