Skip to content

Commit

Permalink
Update preinst
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis90x authored Jan 3, 2025
1 parent 0a9ceb0 commit 0977d1d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions homeassistant-supervised/DEBIAN/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ warn ""

# Check if we are running on a supported OS
BYPASS_OS_CHECK=${BYPASS_OS_CHECK:-false}

CURRENT_OS=$(lsb_release -d)
if [[ $CURRENT_OS != *"Debian GNU/Linux 11 (bullseye)"* ]]; then
# Strip first feild of string
CURRENT_OS=$(echo $CURRENT_OS | cut -d' ' -f2-)

supported_os=("Debian GNU/Linux 12 (bookworm)")

CURRENT_OS=$(lsb_release -d | awk -F"\t" '{print $2}')
os_supported=false

for os in "${supported_os[@]}"; do
if [[ $os == "$CURRENT_OS" ]]; then
os_supported=true
break
fi
done

if [[ $os_supported == false ]]; then
if [[ $BYPASS_OS_CHECK != "true" ]]; then
error "${CURRENT_OS} is not supported, but the installation run anyway!"
warn "${CURRENT_OS} is not supported, but the installation run anyway!"
fi
warn "Bypassing OS check..."
warn "${CURRENT_OS} is not officially supported!"
Expand Down

0 comments on commit 0977d1d

Please sign in to comment.