diff options
author | Christian Breunig <christian@breunig.cc> | 2023-12-09 21:35:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-09 21:35:50 +0100 |
commit | 2778f53cc1f9f03a6c145e45082ca95ba21a1a96 (patch) | |
tree | f4d1b4e9d811447080223198b0a44cdce1d7ea75 /src/system/on-dhcp-event.sh | |
parent | bf096599e4bad8a595257654ec5a0a1c4ae2e15a (diff) | |
parent | 2787e7915c1225f05f1e07c62f7c4d1ac9dca5ac (diff) | |
download | vyos-1x-2778f53cc1f9f03a6c145e45082ca95ba21a1a96.tar.gz vyos-1x-2778f53cc1f9f03a6c145e45082ca95ba21a1a96.zip |
Merge pull request #1960 from sarthurdev/kea
dhcp: T3316: Migrate dhcp/dhcpv6 server to Kea
Diffstat (limited to 'src/system/on-dhcp-event.sh')
-rwxr-xr-x | src/system/on-dhcp-event.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/system/on-dhcp-event.sh b/src/system/on-dhcp-event.sh index 49e53d7e1..7b25bf338 100755 --- a/src/system/on-dhcp-event.sh +++ b/src/system/on-dhcp-event.sh @@ -15,20 +15,20 @@ if [ $# -lt 5 ]; then fi action=$1 -client_name=$2 -client_ip=$3 -client_mac=$4 -domain=$5 +client_name=$LEASE4_HOSTNAME +client_ip=$LEASE4_ADDRESS +client_mac=$LEASE4_HWADDR +domain=$(echo "$client_name" | cut -d"." -f2-) hostsd_client="/usr/bin/vyos-hostsd-client" case "$action" in - commit) # add mapping for new lease + leases4_renew|lease4_recover) # add mapping for new lease 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 + if [ -z "$domain" ]; then client_fqdn_name=$client_name client_search_expr=$client_name else @@ -39,7 +39,7 @@ case "$action" in exit 0 ;; - release) # delete mapping for released address + lease4_release|lease4_expire) # delete mapping for released address) $hostsd_client --delete-hosts --tag "dhcp-server-$client_ip" --apply exit 0 ;; |