zulip/scripts/lib/supported-os
Alex Vandiver 82e3b33f1e install: Check for a supported version of the OS in shell.
Testing for it in Python means that we have to worry about keeping the
`upgrade-zulip-stage-2` backwards-compatible with all versions of
Python which we could ever be upgrading from -- which is all of them.

Factor out the "supported operating systems" check, and share it
between upgrade and install codepaths.

(cherry picked from commit 7f4bc05f8e)
2024-05-07 13:26:48 -07:00

26 lines
549 B
Bash
Executable File

#!/usr/bin/env bash
#
# This script serves only to verify that the OS is a supported
# version, before we attempt to rely on that version in
# upgrade-zulip-stage-3
if [ -f /etc/os-release ]; then
os_info="$(
. /etc/os-release
printf '%s\n' "$ID" "$VERSION_ID"
)"
{
read -r os_id
read -r os_version_id
} <<<"$os_info"
fi
case "$os_id $os_version_id" in
'debian 11' | 'debian 12' | 'ubuntu 20.04' | 'ubuntu 22.04' | 'ubuntu 24.04')
exit 0
;;
*)
exit 1
;;
esac