fix wireguard stopping

This commit is contained in:
Maciej Lebiest 2023-08-01 17:40:45 +02:00
parent 99311fda66
commit 47bc959c53
2 changed files with 15 additions and 4 deletions

View file

@ -1,11 +1,22 @@
#!/bin/bash
stopcontainer()
{
echo "removing wg0 interface"
wg-quick down /data/wg0.conf
echo goodbye
exit 0
}
trap stopcontainer SIGINT
for file in /setup.d/*;
do
echo "Executing setup file $file";
bash -c "$file";
done
wg-quick up /data/wg0.conf && sleep infinity
echo "removing wg0 interface"
wg-quick down /data/wg0.conf
wg-quick up /data/wg0.conf
while true; do sleep 5; done