Skip to content

Commit

Permalink
Update OS support
Browse files Browse the repository at this point in the history
- Remove CentOS 7 and CentOS 8 Stream, which have reached EOL.
- Add Alpine Linux 3.20 and remove 3.18.
  • Loading branch information
hwdsl2 committed Jul 28, 2024
1 parent 721ea33 commit 9a625db
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 26 deletions.
13 changes: 7 additions & 6 deletions extras/ikev2setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
}
Expand Down
11 changes: 6 additions & 5 deletions extras/vpnupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions extras/vpnupgrade_alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 4 additions & 3 deletions extras/vpnupgrade_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions vpnsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions vpnsetup_alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 4 additions & 3 deletions vpnsetup_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9a625db

Please sign in to comment.