Skip to content
Snippets Groups Projects
Commit c3f8b808 authored by Fabian Bläse's avatar Fabian Bläse
Browse files

fff-gateway: Add sanity checks


This adds two checks:
- Does gateway config exist?
- Does gateway config version match?

Signed-off-by: default avatarFabian Bläse <fabian@blaese.de>
Tested-by: default avatarFabian Bläse <fabian@blaese.de>
Reviewed-by: default avatarRobert Langhammer <rlanghammer@web.de>
parent 40e1577a
No related branches found
No related tags found
No related merge requests found
configure() {
local expected_version=1
local config_version=$(uci -q get gateway.meta.config_version)
# check if gateway config exists
if ! uci 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 [ "$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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment