File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
root/etc/s6-overlay/s6-rc.d/svc-wireguard Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22# shellcheck shell=bash
33
4- if [[ -f "/app /activeconfs" ]]; then
5- . /app /activeconfs
4+ if [[ -f "/run /activeconfs" ]]; then
5+ . /run /activeconfs
66 for tunnel in $(printf '%s\n' "${WG_CONFS[@]}" | tac | tr '\n' ' '; echo); do
77 echo "**** Disabling tunnel ${tunnel} ****"
88 wg-quick down "${tunnel}" || :
99 done
1010 echo "**** All tunnels are down ****"
11- rm -rf /app /activeconfs
11+ rm -rf /run /activeconfs
1212fi
Original file line number Diff line number Diff line change 22# shellcheck shell=bash
33
44unset WG_CONFS
5- rm -rf /app /activeconfs
5+ rm -rf /run /activeconfs
66# Enumerate interfaces
77for wgconf in $(ls /config/wg_confs/*.conf); do
88 if grep -q "\[Interface\]" "${wgconf}"; then
@@ -23,13 +23,13 @@ unset FAILED
2323for tunnel in ${WG_CONFS[@]}; do
2424 echo "**** Activating tunnel ${tunnel} ****"
2525 if ! wg-quick up "${tunnel}"; then
26- FAILED="${tunnel}"
27- break
26+ FAILED="${tunnel}"
27+ break
2828 fi
2929done
3030
3131if [[ -z "${FAILED}" ]]; then
32- declare -p WG_CONFS > /app /activeconfs
32+ declare -p WG_CONFS > /run /activeconfs
3333 echo "**** All tunnels are now active ****"
3434else
3535 echo "**** Tunnel ${FAILED} failed, will stop all others! ****"
You can’t perform that action at this time.
0 commit comments