fff-layer-config: move fff to gateway

With this patch, the layer3 config is summearized in one place on
/etc/config/gateway

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2022-02-28 08:11:59 +01:00
parent 27baecaf37
commit 18ba1e00fa
1 changed files with 3 additions and 12 deletions

View File

@ -1,36 +1,27 @@
configure() {
## set hostname
if name=$(uci -q get fff.system.hostname); then
if name=$(uci -q get gateway.meta.hostname); then
uci -q set system.@system[0].hostname="$name"
else
echo "WARNING: No hostname set!"
fi
## set contact
if ! contact=$(uci -q get fff.system.contact); then
if ! contact=$(uci -q get gateway.meta.contact); then
echo "WARNING: No contact set!"
fi
## set location
if ! lat=$(uci -q get fff.system.latitude) || ! long=$(uci -q get fff.system.longitude); then
if ! lat=$(uci -q get gateway.meta.latitude) || ! long=$(uci -q get gateway.meta.longitude); then
echo "WARNING: No location set!"
fi
## hoodname
if hood=$(uci -q get fff.system.hoodname); then
uci -q set "system.@system[0].hood=$hood"
else
echo "WARNING: No hoodname set!"
fi
}
apply() {
uci commit system
uci commit fff
echo "$(uci get "system.@system[0].hostname")" > /proc/sys/kernel/hostname
}
revert() {
uci revert system
uci revert fff
}