Skip to content

Commit

Permalink
Fix oh5 install checks (openhab#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstormi authored Feb 15, 2025
1 parent a5139cc commit 6bf2c27
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion functions/menu.bash
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ show_main_menu() {
RET=$?
if [ $RET -eq 1 ] || [ $RET -eq 255 ]; then return 0; fi
wait_for_apt_to_finish_update
version="$( (openhab4_is_installed && echo "openHAB") || (openhab3_is_installed && echo "openHAB3"))"
version="$( (openhab5_is_installed || openhab4_is_installed && echo "openHAB") || (openhab3_is_installed && echo "openHAB3"))"
# shellcheck disable=SC2154
case "$choice2" in
41\ *) openhab_setup "release";;
Expand Down
2 changes: 1 addition & 1 deletion functions/packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ nginx_setup() {
if (whiptail --title "nginx installation" --yes-button "Continue" --no-button "Cancel" --yesno "$introText" 9 80); then echo "OK"; else echo "CANCELED"; return 0; fi

echo "$(timestamp) [openHABian] Configuring nginx authentication options... "
if openhab4_is_installed || openhab3_is_installed || (whiptail --title "Authentication setup" --yesno "Would you like to secure your openHAB interface with username and password?" 7 80); then
if openhab_is_installed || (whiptail --title "Authentication setup" --yesno "Would you like to secure your openHAB interface with username and password?" 7 80); then
auth="true"
fi
if [[ "$auth" == "true" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions functions/system.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ whiptail_check() {
##
system_upgrade() {
local upgradeText="ATTENTION !\\n\\nYou chose upgrade ALL of your software packages in one go.\\nNote this will include upgrading openHAB itself to its latest version which might be a major upgrade and can break your working system.\\n\\n Are you sure this is what you want?\\n"
local OH4upgradeText="ATTENTION !\\n\\nYou chose to upgrade ALL of your software packages\\nThis is not possible when you are not on the current major version of openHAB, OH4.\\n\\nIn order to upgrade to openHAB 4 first, use the next menu option."
local OH4upgradeText="ATTENTION !\\n\\nYou chose to upgrade ALL of your software packages\\nThis is not possible when you are not on the current major version of openHAB, OH4, or the version under development, OH5.\\n\\nIn order to upgrade to openHAB 4 first, use the next menu option."

echo "$(timestamp) [openHABian] Updating repositories and upgrading installed packages..."
if [[ -n "$INTERACTIVE" ]]; then
if openhab4_is_installed; then
if openhab5_is_installed || openhab4_is_installed; then
if ! (whiptail --title "Upgrade ALL software" --yes-button "Continue" --no-button "Cancel" --yesno "$upgradeText" 12 80); then echo "CANCELED"; return 1; fi
else
whiptail --title "Old openHAB version" --msgbox "$OH4upgradeText" 7 80
Expand Down
1 change: 1 addition & 0 deletions functions/zram.bash
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ init_zram_mounts() {
if ! cond_redirect rm -f /var/log/zram-config; then echo "FAILED (zram-config link)"; return 1; fi
if cond_redirect rm -f /etc/logrotate.d/zram-config; then echo "OK"; else echo "FAILED (logrotate)"; return 1; fi
elif zram_is_installed; then
# shellcheck disable=SC2154
if [[ $1 == "autoupdate" ]] && [[ -n $zram_reset ]]; then return 0; fi
echo -n "$(timestamp) [openHABian] Updating zram service... "
if ! cond_redirect systemctl stop zram-config.service; then echo "FAILED (stop zram)"; return 1; fi
Expand Down

0 comments on commit 6bf2c27

Please sign in to comment.