fff-gateway: improve order of commands for config version check

Move retrieval of config version, as it makes sense to check for
existance of containing file beforehand.

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:52 +02:00
parent 4791c24608
commit 6d91d805a7
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,4 @@
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."
@ -10,6 +7,9 @@ configure() {
fi
# check version of configuration
local expected_version=1
local config_version=$(uci -q get gateway.meta.config_version)
if ! [ -n "$config_version" ]; then
echo "ERROR: No config version given. Supported versions: '$expected_version'"