check-setup: get minifirewall version from internal variable
continuous-integration/drone/push Build is passing Details

there is no other backward compatible way :
* really old version don't have a know version
* some versions used to display the version on each command, but it is removed.
* the VERSION variable seems to be the most forward-compatible way
This commit is contained in:
Jérémy Lecour 2022-07-20 13:43:33 +02:00 committed by Jérémy Lecour
parent f0581fee47
commit aef2637c1e
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* check-setup: get minifirewall version from internal variable (there is no other backward compatible way)
### Deprecated
### Removed

View File

@ -29,7 +29,7 @@ fi
# Check if the firewall file is sourced
minifirewall_config=/etc/default/minifirewall
minifirewall_version=$(/etc/init.d/minifirewall status | head -1 | cut -d ' ' -f 3)
minifirewall_version=$(grep -E -o "^VERSION=(\S+)" /etc/init.d/minifirewall | head -1 | cut -d '=' -f 2 | tr -d "'" | tr -d '"')
if [ -n "${FIREWALL_RULES}" ] \
&& [ -r "${FIREWALL_RULES}" ] \