summaryrefslogtreecommitdiff
path: root/src/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/system')
-rwxr-xr-xsrc/system/on-dhcp-event.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/system/on-dhcp-event.sh b/src/system/on-dhcp-event.sh
index 3c11105d4..52fadd428 100755
--- a/src/system/on-dhcp-event.sh
+++ b/src/system/on-dhcp-event.sh
@@ -63,7 +63,7 @@ case "$action" in
client_ip=${!client_ip_var}
client_mac=${!client_mac_var}
- client_name=${!client_name_var//./}
+ client_name=${!client_name_var%.}
client_subnet_id=${!client_subnet_id_var}
if [ -z "$client_name" ]; then
@@ -73,7 +73,7 @@ case "$action" in
client_domain=$(get_subnet_domain_name $client_subnet_id)
- if [ -n "$client_domain" ]; then
+ if [[ -n "$client_domain" ]] && ! [[ $client_name =~ .*$client_domain$ ]]; then
client_name="$client_name.$client_domain"
fi