diff options
author | Christian Hesse <mail@eworm.de> | 2016-09-30 09:23:27 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2016-09-30 09:23:27 +0200 |
commit | 9d4eaca63c31ca03a1ed1a9ed38639743d44f657 (patch) | |
tree | c21d3bfa000284d30c6c5d66d453003f46d6932f | |
parent | 14ad87900ea7a286a2b1319f8a19df6b3736d42e (diff) | |
download | dyndhcpd-9d4eaca63c31ca03a1ed1a9ed38639743d44f657.tar.gz dyndhcpd-9d4eaca63c31ca03a1ed1a9ed38639743d44f657.tar.zst |
allow to use hostname in config
-rw-r--r-- | config/dhcpd.conf | 2 | ||||
-rw-r--r-- | dyndhcpd.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/config/dhcpd.conf b/config/dhcpd.conf index 65764a8..c69f4e7 100644 --- a/config/dhcpd.conf +++ b/config/dhcpd.conf @@ -9,7 +9,7 @@ ignore client-updates; default-lease-time 21600; max-lease-time 43200; -option domain-name "__DOMAINNAME__"; +option domain-name "__HOSTNAME__.__DOMAINNAME__"; class "PXEClient" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; @@ -239,6 +239,7 @@ int main(int argc, char ** argv) { if (*tmp == '_') { if (replace(&config, &length, &tmp, "__INTERFACE__", interface) || replace(&config, &length, &tmp, "__VERSION__", VERSION) || + replace(&config, &length, &tmp, "__HOSTNAME__", hostname) || replace(&config, &length, &tmp, "__DOMAINNAME__", domainname) || replace(&config, &length, &tmp, "__ADDRESS__", network.address.c) || replace(&config, &length, &tmp, "__NETADDRESS__", network.netaddress.c) || |