Skip to content

Commit 37d7cd2

Browse files
committed
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
1 parent ea64a36 commit 37d7cd2

5 files changed

+46
-6
lines changed

extras/ikev2setup.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,19 @@ EOF
105105
fi
106106
else
107107
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
108-
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
108+
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
109109
|| [ "$os_ver" = "bustersid" ]; then
110110
cat 1>&2 <<EOF
111111
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
112112
This version of Ubuntu/Debian is too old and not supported.
113+
EOF
114+
exit 1
115+
fi
116+
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
117+
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
118+
cat 1>&2 <<EOF
119+
Error: This script does not support Ubuntu 24.10.
120+
You may use e.g. Ubuntu 24.04 LTS instead.
113121
EOF
114122
exit 1
115123
fi
@@ -169,7 +177,7 @@ confirm_or_abort() {
169177
show_header() {
170178
cat <<'EOF'
171179
172-
IKEv2 Script Copyright (c) 2020-2024 Lin Song 28 Jul 2024
180+
IKEv2 Script Copyright (c) 2020-2024 Lin Song 27 Dec 2024
173181
174182
EOF
175183
}

extras/vpnupgrade.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,19 @@ EOF
9696
fi
9797
else
9898
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
99-
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
99+
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
100100
|| [ "$os_ver" = "bustersid" ]; then
101101
cat 1>&2 <<EOF
102102
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
103103
This version of Ubuntu/Debian is too old and not supported.
104+
EOF
105+
exit 1
106+
fi
107+
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
108+
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
109+
cat 1>&2 <<EOF
110+
Error: This script does not support Ubuntu 24.10.
111+
You may use e.g. Ubuntu 24.04 LTS instead.
104112
EOF
105113
exit 1
106114
fi

extras/vpnupgrade_ubuntu.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,19 @@ check_os() {
5757
;;
5858
esac
5959
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
60-
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
60+
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
6161
|| [ "$os_ver" = "bustersid" ]; then
6262
cat 1>&2 <<EOF
6363
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
6464
This version of Ubuntu/Debian is too old and not supported.
65+
EOF
66+
exit 1
67+
fi
68+
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
69+
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
70+
cat 1>&2 <<EOF
71+
Error: This script does not support Ubuntu 24.10.
72+
You may use e.g. Ubuntu 24.04 LTS instead.
6573
EOF
6674
exit 1
6775
fi

vpnsetup.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,19 @@ EOF
128128
fi
129129
else
130130
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
131-
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
131+
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
132132
|| [ "$os_ver" = "bustersid" ]; then
133133
cat 1>&2 <<EOF
134134
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
135135
This version of Ubuntu/Debian is too old and not supported.
136+
EOF
137+
exit 1
138+
fi
139+
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
140+
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
141+
cat 1>&2 <<EOF
142+
Error: This script does not support Ubuntu 24.10.
143+
You may use e.g. Ubuntu 24.04 LTS instead.
136144
EOF
137145
exit 1
138146
fi

vpnsetup_ubuntu.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,19 @@ check_os() {
8888
;;
8989
esac
9090
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
91-
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "jessiesid" ] \
91+
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
9292
|| [ "$os_ver" = "bustersid" ]; then
9393
cat 1>&2 <<EOF
9494
Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
9595
This version of Ubuntu/Debian is too old and not supported.
96+
EOF
97+
exit 1
98+
fi
99+
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ] \
100+
&& [ "$(. /etc/os-release && printf '%s' "$VERSION_ID")" = "24.10" ]; then
101+
cat 1>&2 <<EOF
102+
Error: This script does not support Ubuntu 24.10.
103+
You may use e.g. Ubuntu 24.04 LTS instead.
96104
EOF
97105
exit 1
98106
fi

0 commit comments

Comments
 (0)