Skip to content

Commit

Permalink
ffbs-parker-nodeconfig: Get NTP server from site
Browse files Browse the repository at this point in the history
This removes a hard-coded value.
Previously, this scripts have only been used by Freifunk Braunschweig.
There hard-coding was no issue.
Now, with more communities wanting to try parker out, we have to fix
those.

The `ntp_servers` list has already been introduced by Gluon upstream.
With this change we re-use this value here.

This also means that the NTP-server for the nodes should be accessible
for the clients as well.
  • Loading branch information
SmithChart committed Nov 6, 2024
1 parent de61e27 commit 124573c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ffbs-parker-nodeconfig/check_site.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
need_string({ "parker", "config_server" })
need_string({ "parker", "config_pubkey" })
need_string_array({'ntp_servers'})
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/lua

local site = require 'gluon.site'
local ntp_server = site.ntp_servers()[1]

local uci = require('uci')
local x = uci.cursor()
x:set('dhcp', 'client' , 'dhcp_option', {'option:ntp-server,172.16.0.123'})
x:commit('dhcp')
x:set('dhcp', 'client' , 'dhcp_option', {'option:ntp-server,' .. ntp_server})
x:commit('dhcp')

0 comments on commit 124573c

Please sign in to comment.