Skip to content

Commit d4991a0

Browse files
authored
Merge pull request #43 from linuxserver/test
simplify module test
2 parents 1dbd320 + eee89e0 commit d4991a0

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
268268

269269
## Versions
270270

271+
* **25.06.20:** - Simplify module tests, prevent iptables issues from resulting in false negatives.
271272
* **19.06.20:** - Add support for Ubuntu Focal (20.04) kernels. Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs.
272273
* **29.05.20:** - Add support for 64bit raspbian.
273274
* **28.04.20:** - Add Buster/Stretch backports repos for Debian. Tested with OMV 5 and OMV 4 (on kernel 4.19.0-0.bpo.8-amd64).

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ app_setup_block: |
8585
8686
# changelog
8787
changelogs:
88+
- { date: "25.06.20:", desc: "Simplify module tests, prevent iptables issues from resulting in false negatives." }
8889
- { date: "19.06.20:", desc: "Add support for Ubuntu Focal (20.04) kernels. Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs." }
8990
- { date: "29.05.20:", desc: "Add support for 64bit raspbian." }
9091
- { date: "28.04.20:", desc: "Add Buster/Stretch backports repos for Debian. Tested with OMV 5 and OMV 4 (on kernel 4.19.0-0.bpo.8-amd64)." }

root/etc/cont-init.d/30-config

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
mkdir -p /config/{templates,coredns}
44

55
# check for wireguard module
6-
if grep -q wireguard /proc/modules; then
7-
echo "**** It seems the wireguard module is already loaded, let's test to make sure it works. ****"
8-
/app/wireguard-tools/contrib/ncat-client-server/client-quick.sh
9-
wg-quick up demo
10-
if wg show | grep -q demo; then
11-
echo "**** The module is working properly, skipping kernel header install and module compilation. ****"
12-
SKIP_COMPILE="true"
13-
else
14-
echo "**** The module is not functional, will attempt kernel header install and module compilation. ****"
15-
fi
16-
wg-quick down demo
17-
rm -f /etc/wireguard/demo.conf
6+
ip link del dev test 2>/dev/null
7+
if ip link add dev test type wireguard; then
8+
echo "**** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****"
9+
SKIP_COMPILE="true"
10+
ip link del dev test
1811
else
19-
echo "**** The wireguard module is not loaded, will attempt kernel header install and module compilation. ****"
12+
echo "**** The wireguard module is not active, will attempt kernel header install and module compilation. ****"
2013
fi
2114

2215
# install headers if necessary
@@ -133,18 +126,14 @@ DUDE
133126
make -C wireguard-linux-compat/src -j$(nproc)
134127
make -C wireguard-linux-compat/src install
135128
echo "**** Let's test our new module. ****"
136-
/app/wireguard-tools/contrib/ncat-client-server/client-quick.sh
137-
wg-quick up demo
138-
if wg show | grep -q demo; then
139-
echo "**** The module is working properly, moving forward with setup. ****"
129+
ip link del dev test 2>/dev/null
130+
if ip link add dev test type wireguard; then
131+
echo "**** The module is active, moving forward with setup. ****"
132+
ip link del dev test
140133
else
141-
wg-quick down demo
142-
rm -f /etc/wireguard/demo.conf
143-
echo "**** The module is not working, review the logs. Sleeping now. . . ****"
134+
echo "**** The module is not active, review the logs. Sleeping now. . . ****"
144135
sleep infinity
145136
fi
146-
wg-quick down demo
147-
rm -f /etc/wireguard/demo.conf
148137
else
149138
echo "**** Kernel headers don't seem to be available, can't compile the module. Sleeping now. . . ****"
150139
sleep infinity

0 commit comments

Comments
 (0)