Skip to content

Commit 8ccf5d7

Browse files
committed
Flag when wg module is built
1 parent 6fdaa1c commit 8ccf5d7

File tree

1 file changed

+5
-2
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-wireguard-module

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ if ip link add dev test type wireguard; then
99
echo "**** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****"
1010
SKIP_COMPILE="true"
1111
ip link del dev test
12-
if capsh --print | grep "Current:" | grep -q "cap_sys_module"; then
13-
echo "**** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****"
12+
if [[ ! -f /built_wireguard_module ]]; then
13+
if capsh --print | grep "Current:" | grep -q "cap_sys_module"; then
14+
echo "**** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****"
15+
fi
1416
fi
1517
else
1618
echo "**** The wireguard module is not active, will attempt kernel header install and module compilation. If you believe that your kernel should have wireguard support already, make sure that it is activated via modprobe! ****"
@@ -152,6 +154,7 @@ DUDE
152154
if ip link add dev test type wireguard; then
153155
echo "**** The module is active, moving forward with setup. ****"
154156
ip link del dev test
157+
touch /built_wireguard_module
155158
else
156159
echo "**** The module is not active, review the logs. Sleeping now. . . ****"
157160
sleep infinity

0 commit comments

Comments
 (0)