1
0
mirror of synced 2025-01-18 06:01:46 +03:00

Update OS check

- 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
This commit is contained in:
hwdsl2 2024-12-27 09:11:25 -06:00
parent ea64a364b3
commit 37d7cd2418
5 changed files with 46 additions and 6 deletions

View File

@ -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
@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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