diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-02-21 19:13:59 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-02-21 19:13:59 +0100 |
commit | 944a665cfc19cca1af9d46a70fb31ba1f4893d68 (patch) | |
tree | 10583e96ba4164996a2e00cdab7d9c25afa60b39 /src/system | |
parent | 0573d78195703eed8776b0ece7ee9f05c4d5217f (diff) | |
download | vyos-1x-944a665cfc19cca1af9d46a70fb31ba1f4893d68.tar.gz vyos-1x-944a665cfc19cca1af9d46a70fb31ba1f4893d68.zip |
[dhcp] T1211: avoid blank DHCP hostnames taking down DNS
Diffstat (limited to 'src/system')
-rwxr-xr-x | src/system/on-dhcp-event.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/system/on-dhcp-event.sh b/src/system/on-dhcp-event.sh index d671bffd6..02bbd4c3c 100755 --- a/src/system/on-dhcp-event.sh +++ b/src/system/on-dhcp-event.sh @@ -22,6 +22,11 @@ domain=$5 file=/etc/hosts changes=0 +if [ -z "$client_name" ]; then + logger -s -t on-dhcp-event "Client name was empty, using MAC \"$client_mac\" instead" + client_name=$(echo "client-"$client_mac | tr : -) +fi + if [ "$domain" == "..YYZ!" ]; then client_fqdn_name=$client_name client_search_expr=$client_name |