Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 124573c

Browse files
committedNov 6, 2024
ffbs-parker-nodeconfig: Get NTP server from site
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.
1 parent de61e27 commit 124573c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎ffbs-parker-nodeconfig/check_site.lua

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
need_string({ "parker", "config_server" })
22
need_string({ "parker", "config_pubkey" })
3+
need_string_array({'ntp_servers'})
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/lua
22

3+
local site = require 'gluon.site'
4+
local ntp_server = site.ntp_servers()[1]
35

46
local uci = require('uci')
57
local x = uci.cursor()
6-
x:set('dhcp', 'client' , 'dhcp_option', {'option:ntp-server,172.16.0.123'})
7-
x:commit('dhcp')
8+
x:set('dhcp', 'client' , 'dhcp_option', {'option:ntp-server,' .. ntp_server})
9+
x:commit('dhcp')

0 commit comments

Comments
 (0)
Please sign in to comment.