diff --git a/README.md b/README.md index 29519c0b..1225d2ff 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/readme-vars.yml b/readme-vars.yml index f9966e53..0ed495f2 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -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)." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 318ad0fe..ea173709 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -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