21 lines
274 B
Plaintext
21 lines
274 B
Plaintext
|
#!/usr/bin/with-contenv bash
|
||
|
|
||
|
# Adapted from https://github.com/linuxserver/docker-wireguard
|
||
|
|
||
|
if [ "$ENABLE_WIREGUARD" = false ] ; then
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
_term() {
|
||
|
echo "Caught SIGTERM signal!"
|
||
|
wg-quick down wg0
|
||
|
}
|
||
|
|
||
|
trap _term SIGTERM
|
||
|
|
||
|
wg-quick up wg0
|
||
|
|
||
|
sleep infinity &
|
||
|
|
||
|
wait
|