fix wireguard stopping
This commit is contained in:
parent
99311fda66
commit
47bc959c53
2 changed files with 15 additions and 4 deletions
|
@ -17,6 +17,6 @@ RUN dnf install -y \
|
|||
chmod +x /usr/bin/entrypoint.sh && \
|
||||
mkdir /setup.d
|
||||
|
||||
STOPSIGNAL SIGALRM
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue