Skip to content

Commit 17aa72c

Browse files
committed
Update OS support
- Add support for Debian 13 - Cleanup
1 parent 4612cce commit 17aa72c

File tree

5 files changed

+33
-72
lines changed

5 files changed

+33
-72
lines changed

extras/vpnuninstall.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,9 @@ check_os() {
5555
[Uu]buntu)
5656
os_type=ubuntu
5757
;;
58-
[Dd]ebian|[Kk]ali)
58+
[Dd]ebian|[Kk]ali|[Rr]aspbian)
5959
os_type=debian
6060
;;
61-
[Rr]aspbian)
62-
os_type=raspbian
63-
;;
6461
[Aa]lpine)
6562
os_type=alpine
6663
;;
@@ -92,7 +89,7 @@ check_iface() {
9289
def_state=$(cat "/sys/class/net/$def_iface/operstate" 2>/dev/null)
9390
if [ -n "$def_state" ] && [ "$def_state" != "down" ]; then
9491
check_wl=0
95-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
92+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
9693
if ! uname -m | grep -qi -e '^arm' -e '^aarch64'; then
9794
check_wl=1
9895
fi
@@ -161,7 +158,7 @@ remove_ipsec() {
161158

162159
remove_xl2tpd() {
163160
bigecho "Removing xl2tpd..."
164-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
161+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
165162
export DEBIAN_FRONTEND=noninteractive
166163
apt-get -yqq purge xl2tpd >/dev/null
167164
elif [ "$os_type" = "alpine" ]; then
@@ -232,7 +229,7 @@ get_vpn_subnets() {
232229

233230
update_iptables_rules() {
234231
use_nft=0
235-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ] \
232+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] \
236233
|| [ "$os_type" = "alpine" ]; then
237234
IPT_FILE=/etc/iptables.rules
238235
IPT_FILE2=/etc/iptables/rules.v4
@@ -273,7 +270,7 @@ update_iptables_rules() {
273270
$ipp -s "$XAUTH_NET" -o "$NET_IFACE" -m policy --dir out --pol none -j MASQUERADE
274271
$ipp -s "$L2TP_NET" -o "$NET_IFACE" -j MASQUERADE
275272
iptables-save > "$IPT_FILE"
276-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
273+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
277274
if [ -f "$IPT_FILE2" ]; then
278275
conf_bk "$IPT_FILE2"
279276
/bin/cp -f "$IPT_FILE" "$IPT_FILE2"

extras/vpnupgrade.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,9 @@ check_os() {
7474
[Uu]buntu)
7575
os_type=ubuntu
7676
;;
77-
[Dd]ebian|[Kk]ali)
77+
[Dd]ebian|[Kk]ali|[Rr]aspbian)
7878
os_type=debian
7979
;;
80-
[Rr]aspbian)
81-
os_type=raspbian
82-
;;
8380
[Aa]lpine)
8481
os_type=alpine
8582
;;
@@ -107,16 +104,6 @@ Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
107104
EOF
108105
exit 1
109106
fi
110-
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ]; then
111-
ubuntu_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID")
112-
if [ "$ubuntu_ver" = "24.10" ] || [ "$ubuntu_ver" = "25.04" ]; then
113-
cat 1>&2 <<EOF
114-
Error: This script does not support Ubuntu 24.10 or 25.04.
115-
You may use e.g. Ubuntu 24.04 LTS instead.
116-
EOF
117-
exit 1
118-
fi
119-
fi
120107
fi
121108
fi
122109
}
@@ -134,7 +121,7 @@ EOF
134121

135122
install_pkgs() {
136123
if ! command -v wget >/dev/null 2>&1; then
137-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
124+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
138125
export DEBIAN_FRONTEND=noninteractive
139126
(
140127
set -x

extras/vpnupgrade_ubuntu.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ check_os() {
5757
;;
5858
esac
5959
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
60-
if [ "$os_ver" = 13 ]; then
61-
cat 1>&2 <<EOF
62-
Error: This script does not currently support Debian 13.
63-
You may use e.g. Debian 12 instead.
64-
EOF
65-
exit 1
66-
fi
6760
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
6861
|| [ "$os_ver" = "bustersid" ]; then
6962
cat 1>&2 <<EOF
@@ -74,13 +67,6 @@ EOF
7467
fi
7568
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ]; then
7669
ubuntu_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID")
77-
if [ "$ubuntu_ver" = "24.10" ] || [ "$ubuntu_ver" = "25.04" ]; then
78-
cat 1>&2 <<EOF
79-
Error: This script does not support Ubuntu 24.10 or 25.04.
80-
You may use e.g. Ubuntu 24.04 LTS instead.
81-
EOF
82-
exit 1
83-
fi
8470
fi
8571
}
8672

@@ -185,14 +171,23 @@ update_apt_cache() {
185171

186172
install_pkgs() {
187173
p1=libcurl4-nss-dev
188-
[ "$os_ver" = "trixiesid" ] && p1=libcurl4-gnutls-dev
174+
if [ "$os_ver" = "trixiesid" ] || [ "$os_ver" = 13 ]; then
175+
p1=libcurl4-gnutls-dev
176+
fi
189177
(
190178
set -x
191179
apt-get -yqq install libnss3-dev libnspr4-dev pkg-config \
192180
libpam0g-dev libcap-ng-dev libcap-ng-utils libselinux1-dev \
193181
$p1 libnss3-tools libevent-dev libsystemd-dev \
194182
flex bison gcc make wget sed >/dev/null
195183
) || exiterr2
184+
if { [ "$os_type" = "ubuntu" ] && printf '%s\n%s' "24.10" "$ubuntu_ver" | sort -C -V; } \
185+
|| [ "$os_ver" = 13 ]; then
186+
(
187+
set -x
188+
apt-get -yqq install systemd-dev >/dev/null
189+
) || exiterr2
190+
fi
196191
}
197192

198193
get_libreswan() {

vpnsetup.sh

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,9 @@ check_os() {
106106
[Uu]buntu)
107107
os_type=ubuntu
108108
;;
109-
[Dd]ebian|[Kk]ali)
109+
[Dd]ebian|[Kk]ali|[Rr]aspbian)
110110
os_type=debian
111111
;;
112-
[Rr]aspbian)
113-
os_type=raspbian
114-
;;
115112
[Aa]lpine)
116113
os_type=alpine
117114
;;
@@ -139,16 +136,6 @@ Error: This script requires Debian >= 10 or Ubuntu >= 20.04.
139136
EOF
140137
exit 1
141138
fi
142-
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ]; then
143-
ubuntu_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID")
144-
if [ "$ubuntu_ver" = "24.10" ] || [ "$ubuntu_ver" = "25.04" ]; then
145-
cat 1>&2 <<EOF
146-
Error: This script does not support Ubuntu 24.10 or 25.04.
147-
You may use e.g. Ubuntu 24.04 LTS instead.
148-
EOF
149-
exit 1
150-
fi
151-
fi
152139
fi
153140
fi
154141
}
@@ -161,7 +148,7 @@ check_iface() {
161148
def_state=$(cat "/sys/class/net/$def_iface/operstate" 2>/dev/null)
162149
check_wl=0
163150
if [ -n "$def_state" ] && [ "$def_state" != "down" ]; then
164-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
151+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
165152
if ! uname -m | grep -qi -e '^arm' -e '^aarch64'; then
166153
check_wl=1
167154
fi
@@ -228,7 +215,7 @@ wait_for_apt() {
228215
while fuser "$apt_lk" "$pkg_lk" >/dev/null 2>&1 \
229216
|| lsof "$apt_lk" >/dev/null 2>&1 || lsof "$pkg_lk" >/dev/null 2>&1; do
230217
[ "$count" = 0 ] && echo "## Waiting for apt to be available..."
231-
[ "$count" -ge 100 ] && exiterr "Could not get apt/dpkg lock."
218+
[ "$count" -ge 200 ] && exiterr "Could not get apt/dpkg lock."
232219
count=$((count+1))
233220
printf '%s' '.'
234221
sleep 3
@@ -237,7 +224,7 @@ wait_for_apt() {
237224

238225
install_pkgs() {
239226
if ! command -v wget >/dev/null 2>&1; then
240-
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
227+
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ]; then
241228
wait_for_apt
242229
export DEBIAN_FRONTEND=noninteractive
243230
(

vpnsetup_ubuntu.sh

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ check_os() {
8888
;;
8989
esac
9090
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
91-
if [ "$os_ver" = 13 ]; then
92-
cat 1>&2 <<EOF
93-
Error: This script does not currently support Debian 13.
94-
You may use e.g. Debian 12 instead.
95-
EOF
96-
exit 1
97-
fi
9891
if [ "$os_ver" = 8 ] || [ "$os_ver" = 9 ] || [ "$os_ver" = "stretchsid" ] \
9992
|| [ "$os_ver" = "bustersid" ]; then
10093
cat 1>&2 <<EOF
@@ -105,13 +98,6 @@ EOF
10598
fi
10699
if [ "$os_ver" = "trixiesid" ] && [ -f /etc/os-release ]; then
107100
ubuntu_ver=$(. /etc/os-release && printf '%s' "$VERSION_ID")
108-
if [ "$ubuntu_ver" = "24.10" ] || [ "$ubuntu_ver" = "25.04" ]; then
109-
cat 1>&2 <<EOF
110-
Error: This script does not support Ubuntu 24.10 or 25.04.
111-
You may use e.g. Ubuntu 24.04 LTS instead.
112-
EOF
113-
exit 1
114-
fi
115101
fi
116102
}
117103

@@ -224,7 +210,7 @@ wait_for_apt() {
224210
while fuser "$apt_lk" "$pkg_lk" >/dev/null 2>&1 \
225211
|| lsof "$apt_lk" >/dev/null 2>&1 || lsof "$pkg_lk" >/dev/null 2>&1; do
226212
[ "$count" = 0 ] && echo "## Waiting for apt to be available..."
227-
[ "$count" -ge 100 ] && exiterr "Could not get apt/dpkg lock."
213+
[ "$count" -ge 200 ] && exiterr "Could not get apt/dpkg lock."
228214
count=$((count+1))
229215
printf '%s' '.'
230216
sleep 3
@@ -272,15 +258,24 @@ detect_ip() {
272258
install_vpn_pkgs() {
273259
bigecho "Installing packages required for the VPN..."
274260
p1=libcurl4-nss-dev
275-
[ "$os_ver" = "trixiesid" ] && p1=libcurl4-gnutls-dev
261+
if [ "$os_ver" = "trixiesid" ] || [ "$os_ver" = 13 ]; then
262+
p1=libcurl4-gnutls-dev
263+
fi
276264
(
277265
set -x
278266
apt-get -yqq install libnss3-dev libnspr4-dev pkg-config \
279267
libpam0g-dev libcap-ng-dev libcap-ng-utils libselinux1-dev \
280268
$p1 flex bison gcc make libnss3-tools \
281269
libevent-dev libsystemd-dev uuid-runtime ppp xl2tpd >/dev/null
282270
) || exiterr2
283-
if [ "$os_type" = "debian" ] && [ "$os_ver" = 12 ]; then
271+
if { [ "$os_type" = "ubuntu" ] && printf '%s\n%s' "24.10" "$ubuntu_ver" | sort -C -V; } \
272+
|| [ "$os_ver" = 13 ]; then
273+
(
274+
set -x
275+
apt-get -yqq install systemd-dev >/dev/null
276+
) || exiterr2
277+
fi
278+
if [ "$os_type" = "debian" ] && printf '%s\n%s' "12" "$os_ver" | sort -C -V; then
284279
(
285280
set -x
286281
apt-get -yqq install rsyslog >/dev/null

0 commit comments

Comments
 (0)