Skip to content

Commit 3efd425

Browse files
authored
Change distro version check from lsb_release to os-release (#2436)
1 parent a81c186 commit 3efd425

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

setup/preflight.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ if [[ $EUID -ne 0 ]]; then
88
exit 1
99
fi
1010

11-
# Check that we are running on Ubuntu 20.04 LTS (or 20.04.xx).
12-
if [ "$( lsb_release --id --short )" != "Ubuntu" ] || [ "$( lsb_release --release --short )" != "22.04" ]; then
11+
# Check that we are running on Ubuntu 22.04 LTS (or 22.04.xx).
12+
# Pull in the variables defined in /etc/os-release but in a
13+
# namespace to avoid polluting our variables.
14+
source <(cat /etc/os-release | sed s/^/OS_RELEASE_/)
15+
if [ "${OS_RELEASE_ID:-}" != "ubuntu" ] || [ "${OS_RELEASE_VERSION_ID:-}" != "22.04" ]; then
1316
echo "Mail-in-a-Box only supports being installed on Ubuntu 22.04, sorry. You are running:"
1417
echo
15-
lsb_release --description --short
18+
echo "${OS_RELEASE_ID:-"Unknown linux distribution"} ${OS_RELEASE_VERSION_ID:-}"
1619
echo
1720
echo "We can't write scripts that run on every possible setup, sorry."
1821
exit 1

0 commit comments

Comments
 (0)