Skip to content

Commit

Permalink
Update OS check
Browse files Browse the repository at this point in the history
- Add a check for Ubuntu 24.10, which is not currently
  supported by this project. You may instead use e.g.
  Ubuntu 24.04 LTS.
- Cleanup
  • Loading branch information
hwdsl2 committed Dec 27, 2024
1 parent ea64a36 commit 37d7cd2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
12 changes: 10 additions & 2 deletions extras/ikev2setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,19 @@ EOF
fi
else
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
|| [ "$os_ver" = "bustersid" ]; then
cat 1>&2 <<EOF
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
This version of Ubuntu/Debian is too old and not supported.
EOF
exit 1
fi
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
cat 1>&2 <<EOF
Error: This script does not support Ubuntu 24.10.
You may use e.g. Ubuntu 24.04 LTS instead.
EOF
exit 1
fi
Expand Down Expand Up @@ -169,7 +177,7 @@ confirm_or_abort() {
show_header() {
cat <<'EOF'
IKEv2 Script Copyright (c) 2020-2024 Lin Song 28 Jul 2024
IKEv2 Script Copyright (c) 2020-2024 Lin Song 27 Dec 2024
EOF
}
Expand Down
10 changes: 9 additions & 1 deletion extras/vpnupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,19 @@ EOF
fi
else
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
|| [ "$os_ver" = "bustersid" ]; then
cat 1>&2 <<EOF
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
This version of Ubuntu/Debian is too old and not supported.
EOF
exit 1
fi
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
cat 1>&2 <<EOF
Error: This script does not support Ubuntu 24.10.
You may use e.g. Ubuntu 24.04 LTS instead.
EOF
exit 1
fi
Expand Down
10 changes: 9 additions & 1 deletion extras/vpnupgrade_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ check_os() {
;;
esac
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
|| [ "$os_ver" = "bustersid" ]; then
cat 1>&2 <<EOF
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
This version of Ubuntu/Debian is too old and not supported.
EOF
exit 1
fi
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
cat 1>&2 <<EOF
Error: This script does not support Ubuntu 24.10.
You may use e.g. Ubuntu 24.04 LTS instead.
EOF
exit 1
fi
Expand Down
10 changes: 9 additions & 1 deletion vpnsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,19 @@ EOF
fi
else
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
|| [ "$os_ver" = "bustersid" ]; then
cat 1>&2 <<EOF
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
This version of Ubuntu/Debian is too old and not supported.
EOF
exit 1
fi
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
cat 1>&2 <<EOF
Error: This script does not support Ubuntu 24.10.
You may use e.g. Ubuntu 24.04 LTS instead.
EOF
exit 1
fi
Expand Down
10 changes: 9 additions & 1 deletion vpnsetup_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,19 @@ check_os() {
;;
esac
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
|| [ "$os_ver" = "bustersid" ]; then
cat 1>&2 <<EOF
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
This version of Ubuntu/Debian is too old and not supported.
EOF
exit 1
fi
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
cat 1>&2 <<EOF
Error: This script does not support Ubuntu 24.10.
You may use e.g. Ubuntu 24.04 LTS instead.
EOF
exit 1
fi
Expand Down

0 comments on commit 37d7cd2

Please sign in to comment.