forked from freifunk-franken/firmware
Adrian Schmutzler
f9a68be465
configuregateway and it's gateway.d files represent a specific functionality that other packages depend on. Thus, it is put into a package of its own so dependencies can be expressed more properly. While at, use the chance to get rid of the ambiguous term "gateway" and rename the script to configure-layer3 and the folders to layer3.d. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Christian Dresel <freifunk@dresel.systems>
37 lines
760 B
Plaintext
37 lines
760 B
Plaintext
configure() {
|
|
## set hostname
|
|
if name=$(uci -q get fff.system.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
|
|
echo "WARNING: No contact set!"
|
|
fi
|
|
|
|
## set location
|
|
if ! lat=$(uci -q get fff.system.latitude) || ! long=$(uci -q get fff.system.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
|
|
}
|