Skip to content

Commit aaac281

Browse files
authored
Merge pull request #339 from linuxserver/master-ro
Add note about iptables modprobe, move activeconfs
2 parents 2442e59 + 640f754 commit aaac281

File tree

3 files changed

+9
-8
lines changed
  • root/etc/s6-overlay/s6-rc.d

3 files changed

+9
-8
lines changed

root/etc/s6-overlay/s6-rc.d/init-wireguard-module/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ if ip link add dev test type wireguard; then
1010
ip link del dev test
1111
if capsh --current | grep "Current:" | grep -q "cap_sys_module"; then
1212
echo "**** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****"
13+
echo "**** If your host does not automatically load the iptables module, you may still need the SYS_MODULE capability. ****"
1314
fi
1415
else
1516
echo "**** The wireguard module is not active. If you believe that your kernel should have wireguard support already, make sure that it is activated via modprobe! ****"
16-
echo "**** If you have an old kernel without wireguard support built-in, you can try using the "legacy" tag for this image to compile the modules from scratch. ****"
17+
echo "**** If you have an old kernel without wireguard support built-in, you can try using the 'legacy' tag for this image to compile the modules from scratch. ****"
1718
sleep infinity
1819
fi
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
if [[ -f "/app/activeconfs" ]]; then
5-
. /app/activeconfs
4+
if [[ -f "/run/activeconfs" ]]; then
5+
. /run/activeconfs
66
for tunnel in $(printf '%s\n' "${WG_CONFS[@]}" | tac | tr '\n' ' '; echo); do
77
echo "**** Disabling tunnel ${tunnel} ****"
88
wg-quick down "${tunnel}" || :
99
done
1010
echo "**** All tunnels are down ****"
11-
rm -rf /app/activeconfs
11+
rm -rf /run/activeconfs
1212
fi

root/etc/s6-overlay/s6-rc.d/svc-wireguard/run

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck shell=bash
33

44
unset WG_CONFS
5-
rm -rf /app/activeconfs
5+
rm -rf /run/activeconfs
66
# Enumerate interfaces
77
for wgconf in $(ls /config/wg_confs/*.conf); do
88
if grep -q "\[Interface\]" "${wgconf}"; then
@@ -23,13 +23,13 @@ unset FAILED
2323
for tunnel in ${WG_CONFS[@]}; do
2424
echo "**** Activating tunnel ${tunnel} ****"
2525
if ! wg-quick up "${tunnel}"; then
26-
FAILED="${tunnel}"
27-
break
26+
FAILED="${tunnel}"
27+
break
2828
fi
2929
done
3030

3131
if [[ -z "${FAILED}" ]]; then
32-
declare -p WG_CONFS > /app/activeconfs
32+
declare -p WG_CONFS > /run/activeconfs
3333
echo "**** All tunnels are now active ****"
3434
else
3535
echo "**** Tunnel ${FAILED} failed, will stop all others! ****"

0 commit comments

Comments
 (0)