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 && \
|
chmod +x /usr/bin/entrypoint.sh && \
|
||||||
mkdir /setup.d
|
mkdir /setup.d
|
||||||
|
|
||||||
STOPSIGNAL SIGALRM
|
STOPSIGNAL SIGINT
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
|
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
#!/bin/bash
|
#!/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/*;
|
for file in /setup.d/*;
|
||||||
do
|
do
|
||||||
echo "Executing setup file $file";
|
echo "Executing setup file $file";
|
||||||
bash -c "$file";
|
bash -c "$file";
|
||||||
done
|
done
|
||||||
|
|
||||||
wg-quick up /data/wg0.conf && sleep infinity
|
wg-quick up /data/wg0.conf
|
||||||
echo "removing wg0 interface"
|
|
||||||
wg-quick down /data/wg0.conf
|
while true; do sleep 5; done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue