Update OS support
- Remove CentOS 7 and CentOS 8 Stream, which have reached EOL. - Add Alpine Linux 3.20 and remove 3.18.
This commit is contained in:
parent
721ea3306b
commit
9a625dba29
@ -60,15 +60,16 @@ check_os() {
|
||||
elif grep -q "release 8" "$rh_file"; then
|
||||
os_ver=8
|
||||
grep -qi stream "$rh_file" && os_ver=8s
|
||||
if [ "$os_type$os_ver" = "centos8" ]; then
|
||||
exiterr "CentOS Linux 8 is EOL and not supported."
|
||||
fi
|
||||
elif grep -q "release 9" "$rh_file"; then
|
||||
os_ver=9
|
||||
grep -qi stream "$rh_file" && os_ver=9s
|
||||
else
|
||||
exiterr "This script only supports CentOS/RHEL 7-9."
|
||||
fi
|
||||
if [ "$os_type" = "centos" ] \
|
||||
&& { [ "$os_ver" = 7 ] || [ "$os_ver" = 8 ] || [ "$os_ver" = 8s ]; }; then
|
||||
exiterr "CentOS Linux $os_ver is EOL and not supported."
|
||||
fi
|
||||
elif grep -qs "Amazon Linux release 2 " /etc/system-release; then
|
||||
os_type=amzn
|
||||
os_ver=2
|
||||
@ -99,8 +100,8 @@ EOF
|
||||
esac
|
||||
if [ "$os_type" = "alpine" ]; then
|
||||
os_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID" | cut -d '.' -f 1,2)
|
||||
if [ "$os_ver" != "3.18" ] && [ "$os_ver" != "3.19" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.18/3.19."
|
||||
if [ "$os_ver" != "3.19" ] && [ "$os_ver" != "3.20" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.19/3.20."
|
||||
fi
|
||||
else
|
||||
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
|
||||
@ -168,7 +169,7 @@ confirm_or_abort() {
|
||||
show_header() {
|
||||
cat <<'EOF'
|
||||
|
||||
IKEv2 Script Copyright (c) 2020-2024 Lin Song 14 Apr 2024
|
||||
IKEv2 Script Copyright (c) 2020-2024 Lin Song 28 Jul 2024
|
||||
|
||||
EOF
|
||||
}
|
||||
|
@ -51,15 +51,16 @@ check_os() {
|
||||
elif grep -q "release 8" "$rh_file"; then
|
||||
os_ver=8
|
||||
grep -qi stream "$rh_file" && os_ver=8s
|
||||
if [ "$os_type$os_ver" = "centos8" ]; then
|
||||
exiterr "CentOS Linux 8 is EOL and not supported."
|
||||
fi
|
||||
elif grep -q "release 9" "$rh_file"; then
|
||||
os_ver=9
|
||||
grep -qi stream "$rh_file" && os_ver=9s
|
||||
else
|
||||
exiterr "This script only supports CentOS/RHEL 7-9."
|
||||
fi
|
||||
if [ "$os_type" = "centos" ] \
|
||||
&& { [ "$os_ver" = 7 ] || [ "$os_ver" = 8 ] || [ "$os_ver" = 8s ]; }; then
|
||||
exiterr "CentOS Linux $os_ver is EOL and not supported."
|
||||
fi
|
||||
elif grep -qs "Amazon Linux release 2 " /etc/system-release; then
|
||||
os_type=amzn
|
||||
os_ver=2
|
||||
@ -90,8 +91,8 @@ EOF
|
||||
esac
|
||||
if [ "$os_type" = "alpine" ]; then
|
||||
os_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID" | cut -d '.' -f 1,2)
|
||||
if [ "$os_ver" != "3.18" ] && [ "$os_ver" != "3.19" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.18/3.19."
|
||||
if [ "$os_ver" != "3.19" ] && [ "$os_ver" != "3.20" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.19/3.20."
|
||||
fi
|
||||
else
|
||||
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
|
||||
|
@ -51,8 +51,8 @@ check_os() {
|
||||
;;
|
||||
esac
|
||||
os_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID" | cut -d '.' -f 1,2)
|
||||
if [ "$os_ver" != "3.18" ] && [ "$os_ver" != "3.19" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.18/3.19."
|
||||
if [ "$os_ver" != "3.19" ] && [ "$os_ver" != "3.20" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.19/3.20."
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -54,15 +54,16 @@ check_os() {
|
||||
elif grep -q "release 8" "$rh_file"; then
|
||||
os_ver=8
|
||||
grep -qi stream "$rh_file" && os_ver=8s
|
||||
if [ "$os_type$os_ver" = "centos8" ]; then
|
||||
exiterr "CentOS Linux 8 is EOL and not supported."
|
||||
fi
|
||||
elif grep -q "release 9" "$rh_file"; then
|
||||
os_ver=9
|
||||
grep -qi stream "$rh_file" && os_ver=9s
|
||||
else
|
||||
exiterr "This script only supports CentOS/RHEL 7-9."
|
||||
fi
|
||||
if [ "$os_type" = "centos" ] \
|
||||
&& { [ "$os_ver" = 7 ] || [ "$os_ver" = 8 ] || [ "$os_ver" = 8s ]; }; then
|
||||
exiterr "CentOS Linux $os_ver is EOL and not supported."
|
||||
fi
|
||||
else
|
||||
cat 1>&2 <<'EOF'
|
||||
Error: This script only supports one of the following OS:
|
||||
|
11
vpnsetup.sh
11
vpnsetup.sh
@ -81,15 +81,16 @@ check_os() {
|
||||
elif grep -q "release 8" "$rh_file"; then
|
||||
os_ver=8
|
||||
grep -qi stream "$rh_file" && os_ver=8s
|
||||
if [ "$os_type$os_ver" = "centos8" ]; then
|
||||
exiterr "CentOS Linux 8 is EOL and not supported."
|
||||
fi
|
||||
elif grep -q "release 9" "$rh_file"; then
|
||||
os_ver=9
|
||||
grep -qi stream "$rh_file" && os_ver=9s
|
||||
else
|
||||
exiterr "This script only supports CentOS/RHEL 7-9."
|
||||
fi
|
||||
if [ "$os_type" = "centos" ] \
|
||||
&& { [ "$os_ver" = 7 ] || [ "$os_ver" = 8 ] || [ "$os_ver" = 8s ]; }; then
|
||||
exiterr "CentOS Linux $os_ver is EOL and not supported."
|
||||
fi
|
||||
elif grep -qs "Amazon Linux release 2 " /etc/system-release; then
|
||||
os_type=amzn
|
||||
os_ver=2
|
||||
@ -122,8 +123,8 @@ EOF
|
||||
esac
|
||||
if [ "$os_type" = "alpine" ]; then
|
||||
os_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID" | cut -d '.' -f 1,2)
|
||||
if [ "$os_ver" != "3.18" ] && [ "$os_ver" != "3.19" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.18/3.19."
|
||||
if [ "$os_ver" != "3.19" ] && [ "$os_ver" != "3.20" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.19/3.20."
|
||||
fi
|
||||
else
|
||||
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
|
||||
|
@ -70,8 +70,8 @@ check_os() {
|
||||
;;
|
||||
esac
|
||||
os_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID" | cut -d '.' -f 1,2)
|
||||
if [ "$os_ver" != "3.18" ] && [ "$os_ver" != "3.19" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.18/3.19."
|
||||
if [ "$os_ver" != "3.19" ] && [ "$os_ver" != "3.20" ]; then
|
||||
exiterr "This script only supports Alpine Linux 3.19/3.20."
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -86,15 +86,16 @@ check_os() {
|
||||
elif grep -q "release 8" "$rh_file"; then
|
||||
os_ver=8
|
||||
grep -qi stream "$rh_file" && os_ver=8s
|
||||
if [ "$os_type$os_ver" = "centos8" ]; then
|
||||
exiterr "CentOS Linux 8 is EOL and not supported."
|
||||
fi
|
||||
elif grep -q "release 9" "$rh_file"; then
|
||||
os_ver=9
|
||||
grep -qi stream "$rh_file" && os_ver=9s
|
||||
else
|
||||
exiterr "This script only supports CentOS/RHEL 7-9."
|
||||
fi
|
||||
if [ "$os_type" = "centos" ] \
|
||||
&& { [ "$os_ver" = 7 ] || [ "$os_ver" = 8 ] || [ "$os_ver" = 8s ]; }; then
|
||||
exiterr "CentOS Linux $os_ver is EOL and not supported."
|
||||
fi
|
||||
else
|
||||
cat 1>&2 <<'EOF'
|
||||
Error: This script only supports one of the following OS:
|
||||
|
Loading…
Reference in New Issue
Block a user