Skip to content

Commit

Permalink
Fix openhab_is_installed check for openHAB 5 snapshots (openhab#1976)
Browse files Browse the repository at this point in the history
* Fix is_openhab_installed check for openHAB 5 snapshots

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Feb 15, 2025
1 parent 649265c commit a5139cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions functions/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -651,21 +651,29 @@ openhab2_is_installed() {
openhab3_is_installed() {
if [[ $(dpkg -s 'openhab' 2> /dev/null | grep -E '^Version' | cut -d ' ' -f2 | cut -d '.' -f1) = 3 ]]; then return 0; else return 1; fi
}
## Function to check if openHAB is installed on the current system. Returns
## Function to check if openHAB 4 is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
## openhab_is_installed()
##
openhab4_is_installed() {
if [[ $(dpkg -s 'openhab' 2> /dev/null | grep -E '^Version' | cut -d ' ' -f2 | cut -d '.' -f1) = 4 ]]; then return 0; else return 1; fi
}
## Function to check if openHAB 5 is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
## openhab_is_installed()
##
openhab5_is_installed() {
if [[ $(dpkg -s 'openhab' 2> /dev/null | grep -E '^Version' | cut -d ' ' -f2 | cut -d '.' -f1) = 5 ]]; then return 0; else return 1; fi
}
## Function to check if openHAB is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
## openhab_is_installed()
##
openhab_is_installed() {
if openhab2_is_installed || openhab3_is_installed || openhab4_is_installed; then return 0; else return 1; fi
if openhab2_is_installed || openhab3_is_installed || openhab4_is_installed || openhab5_is_installed; then return 0; else return 1; fi
}

## Check if amanda is installed
Expand Down

0 comments on commit a5139cc

Please sign in to comment.