You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-wireguard/root/etc/s6-overlay/s6-rc.d/svc-wireguard/finish

13 lines
369 B
Plaintext

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [[ -f "/app/activeconfs" ]]; then
. /app/activeconfs
for tunnel in $(printf '%s\n' "${WG_CONFS[@]}" | tac | tr '\n' ' '; echo); do
echo "**** Disabling tunnel ${tunnel} ****"
wg-quick down "${tunnel}" || :
done
echo "**** All tunnels are down ****"
rm -rf /app/activeconfs
fi