mirror of
https://github.com/linuxserver/docker-wireguard.git
synced 2026-02-20 05:45:43 +08:00
simplify module test
This commit is contained in:
parent
c645264df3
commit
eee89e0289
@ -268,6 +268,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
|
||||
|
||||
## Versions
|
||||
|
||||
* **25.06.20:** - Simplify module tests, prevent iptables issues from resulting in false negatives.
|
||||
* **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.
|
||||
* **29.05.20:** - Add support for 64bit raspbian.
|
||||
* **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).
|
||||
|
||||
@ -85,6 +85,7 @@ app_setup_block: |
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "25.06.20:", desc: "Simplify module tests, prevent iptables issues from resulting in false negatives." }
|
||||
- { 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." }
|
||||
- { date: "29.05.20:", desc: "Add support for 64bit raspbian." }
|
||||
- { 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)." }
|
||||
|
||||
@ -3,20 +3,13 @@
|
||||
mkdir -p /config/{templates,coredns}
|
||||
|
||||
# check for wireguard module
|
||||
if grep -q wireguard /proc/modules; then
|
||||
echo "**** It seems the wireguard module is already loaded, let's test to make sure it works. ****"
|
||||
/app/wireguard-tools/contrib/ncat-client-server/client-quick.sh
|
||||
wg-quick up demo
|
||||
if wg show | grep -q demo; then
|
||||
echo "**** The module is working properly, skipping kernel header install and module compilation. ****"
|
||||
SKIP_COMPILE="true"
|
||||
else
|
||||
echo "**** The module is not functional, will attempt kernel header install and module compilation. ****"
|
||||
fi
|
||||
wg-quick down demo
|
||||
rm -f /etc/wireguard/demo.conf
|
||||
ip link del dev test 2>/dev/null
|
||||
if ip link add dev test type wireguard; then
|
||||
echo "**** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****"
|
||||
SKIP_COMPILE="true"
|
||||
ip link del dev test
|
||||
else
|
||||
echo "**** The wireguard module is not loaded, will attempt kernel header install and module compilation. ****"
|
||||
echo "**** The wireguard module is not active, will attempt kernel header install and module compilation. ****"
|
||||
fi
|
||||
|
||||
# install headers if necessary
|
||||
@ -133,18 +126,14 @@ DUDE
|
||||
make -C wireguard-linux-compat/src -j$(nproc)
|
||||
make -C wireguard-linux-compat/src install
|
||||
echo "**** Let's test our new module. ****"
|
||||
/app/wireguard-tools/contrib/ncat-client-server/client-quick.sh
|
||||
wg-quick up demo
|
||||
if wg show | grep -q demo; then
|
||||
echo "**** The module is working properly, moving forward with setup. ****"
|
||||
ip link del dev test 2>/dev/null
|
||||
if ip link add dev test type wireguard; then
|
||||
echo "**** The module is active, moving forward with setup. ****"
|
||||
ip link del dev test
|
||||
else
|
||||
wg-quick down demo
|
||||
rm -f /etc/wireguard/demo.conf
|
||||
echo "**** The module is not working, review the logs. Sleeping now. . . ****"
|
||||
echo "**** The module is not active, review the logs. Sleeping now. . . ****"
|
||||
sleep infinity
|
||||
fi
|
||||
wg-quick down demo
|
||||
rm -f /etc/wireguard/demo.conf
|
||||
else
|
||||
echo "**** Kernel headers don't seem to be available, can't compile the module. Sleeping now. . . ****"
|
||||
sleep infinity
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user