1
0
mirror of synced 2024-11-29 08:06:04 +03:00
- Fix OS checking: Don't show errors for /etc/redhat-release.
- Fixes #1211.
This commit is contained in:
hwdsl2 2022-08-09 19:34:32 -05:00
parent d22b32d4c6
commit 1dbf897500
8 changed files with 17 additions and 17 deletions

View File

@ -44,8 +44,8 @@ check_os() {
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file" \ if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file" \
|| grep -qs "release 9" "$rh_file"; then || grep -qs "release 9" "$rh_file"; then
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
elif grep -qs "Amazon Linux release 2" /etc/system-release; then elif grep -qs "Amazon Linux release 2" /etc/system-release; then
os_type=amzn os_type=amzn
else else

View File

@ -53,8 +53,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -154,7 +154,7 @@ confirm_or_abort() {
show_header() { show_header() {
cat <<'EOF' cat <<'EOF'
IKEv2 Script Copyright (c) 2020-2022 Lin Song 31 Jul 2022 IKEv2 Script Copyright (c) 2020-2022 Lin Song 9 Aug 2022
EOF EOF
} }

View File

@ -75,8 +75,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then

View File

@ -42,8 +42,8 @@ check_os() {
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file" \ if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file" \
|| grep -qs "release 9" "$rh_file"; then || grep -qs "release 9" "$rh_file"; then
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
elif grep -qs "Amazon Linux release 2" /etc/system-release; then elif grep -qs "Amazon Linux release 2" /etc/system-release; then
os_type=amzn os_type=amzn
else else

View File

@ -43,8 +43,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then

View File

@ -46,8 +46,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then

View File

@ -75,8 +75,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then

View File

@ -80,8 +80,8 @@ check_os() {
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol [ -f /etc/oracle-release ] && os_type=ol
grep -qi rocky "$rh_file" && os_type=rocky grep -qs -i rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qs -i alma "$rh_file" && os_type=alma
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then