1
0
mirror of synced 2024-11-21 20:46:10 +03:00

Update OS check

This commit is contained in:
hwdsl2 2023-06-14 23:52:54 -05:00
parent 2f129f19b3
commit e79e64174c
3 changed files with 9 additions and 1 deletions

View File

@ -93,6 +93,8 @@ check_os() {
elif grep -qs "Amazon Linux release 2 " /etc/system-release; then
os_type=amzn
os_ver=2
elif grep -qs "Amazon Linux release 2023" /etc/system-release; then
exiterr "Amazon Linux 2023 is not supported."
else
os_type=$(lsb_release -si 2>/dev/null)
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")

View File

@ -93,6 +93,8 @@ check_os() {
elif grep -qs "Amazon Linux release 2 " /etc/system-release; then
os_type=amzn
os_ver=2
elif grep -qs "Amazon Linux release 2023" /etc/system-release; then
exiterr "Amazon Linux 2023 is not supported."
else
os_type=$(lsb_release -si 2>/dev/null)
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")

View File

@ -54,7 +54,11 @@ check_root() {
check_os() {
if ! grep -qs "Amazon Linux release 2 " /etc/system-release; then
exiterr "This script only supports Amazon Linux 2."
if grep -qs "Amazon Linux release 2023" /etc/system-release; then
exiterr "Amazon Linux 2023 is not supported."
else
exiterr "This script only supports Amazon Linux 2."
fi
fi
}