forked from freifunk-franken/firmware
Adrian Schmutzler
4791c24608
We check the return code in configuregateway, so let's give success explicitly. This might not be strictly necessary now, but providing it will make our lifes easier if the file is changed later. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Robert Langhammer <rlanghammer@web.de> Reviewed-by: Fabian Bläse <fabian@blaese.de>
28 lines
692 B
Plaintext
28 lines
692 B
Plaintext
configure() {
|
|
local expected_version=1
|
|
local config_version=$(uci -q get gateway.meta.config_version)
|
|
|
|
# check if gateway config exists
|
|
if ! uci -q show gateway > /dev/null; then
|
|
echo "ERROR: Gateway config could not be parsed or does not exist."
|
|
|
|
exit 1
|
|
fi
|
|
|
|
# check version of configuration
|
|
if ! [ -n "$config_version" ]; then
|
|
echo "ERROR: No config version given. Supported versions: '$expected_version'"
|
|
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$config_version" != "$expected_version" ]; then
|
|
echo "ERROR: Invalid config version. Expected '$expected_version', got '$config_version'."
|
|
echo "Please check what has been changed and adjust your config appropriately."
|
|
|
|
exit 1
|
|
fi
|
|
|
|
return 0
|
|
}
|