fff-gateway: provide specific error if config version is not set

This explicitly checks whether the config version is set at all,
instead of just comparing it, and provides a specific error message
for that case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Adrian Schmutzler 2020-04-26 13:49:50 +02:00
parent f8ced0cc04
commit 2f9e5f4af1
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,12 @@ configure() {
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."