Cleanup
- Fix OS checking: Don't show errors for /etc/redhat-release. - Fixes #1211.
This commit is contained in:
parent
d22b32d4c6
commit
1dbf897500
@ -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
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user