diff options
author | Bob <bob@clough.me> | 2018-11-08 17:03:38 +0000 |
---|---|---|
committer | Bob <bob@clough.me> | 2018-11-08 17:41:36 +0000 |
commit | 9f5abb65f04d1ce40532e266e942ad35b8ebae92 (patch) | |
tree | 575b1e7e86ad129d492ca584a596cb652036ff52 /src | |
parent | 15065070b7c22709e259a6ae0cc4a27fd7b59d6b (diff) | |
download | vyos-1x-9f5abb65f04d1ce40532e266e942ad35b8ebae92.tar.gz vyos-1x-9f5abb65f04d1ce40532e266e942ad35b8ebae92.zip |
dhcp - move commit hook into shared-network
Move the on commit in a generated dhcpd.conf into the shared-network
to fix hostfile-update not working.
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dhcp_server.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index 2a2b1fe6c..560c80e7f 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -42,14 +42,6 @@ config_tmpl = """ # log-facility local7; {% if hostfile_update %} -on commit { - set ClientName = pick-first-value(host-decl-name, option fqdn.hostname, option host-name); - set ClientIp = binary-to-ascii(10, 8, ".", leased-address); - set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)); - set ClientDomain = pick-first-value(config-option domain-name, "..YYZ!"); - execute("/usr/libexec/vyos/system/on-dhcp-event.sh", "commit", ClientName, ClientIp, ClientMac, ClientDomain); -} - on release { set ClientName = pick-first-value(host-decl-name, option fqdn.hostname, option host-name); set ClientIp = binary-to-ascii(10, 8, ".",leased-address); @@ -210,7 +202,16 @@ shared-network {{ network.name }} { {%- endif %} } {%- endfor %} - on commit { set shared-networkname = "{{ network.name }}"; } + on commit { + set shared-networkname = "{{ network.name }}"; + {% if hostfile_update -%} + set ClientName = pick-first-value(host-decl-name, option fqdn.hostname, option host-name); + set ClientIp = binary-to-ascii(10, 8, ".", leased-address); + set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)); + set ClientDomain = pick-first-value(config-option domain-name, "..YYZ!"); + execute("/usr/libexec/vyos/system/on-dhcp-event.sh", "commit", ClientName, ClientIp, ClientMac, ClientDomain); + {% endif -%} + } } {%- endif %} {% endfor %} |