Skip to content

Commit

Permalink
make link truly optional
Browse files Browse the repository at this point in the history
  • Loading branch information
f18m committed Oct 28, 2024
1 parent de5c1f8 commit 8ba3cab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ options:
name: "An-important-host-with-reserved-IP"
ip: 192.168.1.15
# the 'link' property accepts a basic golang template. Available variables are 'mac', 'name' and 'ip'
link: "http://{{ ip }}/landing/page"
# e.g. "http://{{ ip }}/landing/page"
link:
dhcp_clients_friendly_names:
- mac: dd:ee:aa:dd:bb:ee
name: "This is a friendly name to label this host, even if it gets a dynamic IP"
# the 'link' property accepts a basic golang template. Available variables are 'mac', 'name' and 'ip'
link: "http://{{ ip }}/landing/page/for/this/dynamic/host"
# e.g. "http://{{ ip }}/landing/page/for/this/dynamic/host"
link:
log_dhcp: true
log_web_ui: false
# this addon uses "host_network: true" so the internal HTTP server will bind on the interface
Expand Down Expand Up @@ -96,11 +98,11 @@ schema:
# the name in this case must be a valid hostname as per RFC 1123 since it is passed to dnsmasq
# that will refuse to start if an invalid hostname format is used
name: match(^[a-zA-Z0-9\-.]*$)
link: str
link: "str?"
dhcp_clients_friendly_names:
- mac: match(^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$)
name: str
link: str
link: "str?"
log_dhcp: bool
log_web_ui: bool
web_ui_port: int
Expand Down
2 changes: 1 addition & 1 deletion rootfs/opt/bin/dnsmasq-dhcp-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ON CONFLICT(mac_addr) DO UPDATE SET
EOF

if [[ $? -eq 0 ]]; then
log_info "Stored in trackerDB updated information for client mac=$mac_addr, hostname=$hostname: last_seen=$last_seen, Ddhcp_server_start_epoch=$dhcp_server_start_counter"
log_info "Stored in trackerDB updated information for client mac=$mac_addr, hostname=$hostname: last_seen=$last_seen, dhcp_server_start_epoch=$dhcp_server_start_counter"
else
log_error "Failed to add/update client. Expect inconsistencies."
fi
Expand Down

0 comments on commit 8ba3cab

Please sign in to comment.