docker/mullvad_wireguard/entrypoint.sh
2023-12-23 18:18:42 +01:00

16 lines
330 B
Bash
Executable File

#!/bin/bash -e
stopwg() {
wg-quick down "$CONF"
}
# See https://mullvad.net/en/help/socks5-proxy
SOCKS_IP='10.64.0.1'
CONF="$(printf '%q\n' /etc/wireguard/*.conf | shuf -n1)"
sed -i "s/^AllowedIPs.*/AllowedIPs = $SOCKS_IP/" /etc/wireguard/*.conf
wg-quick up "$CONF"
trap stopwg SIGHUP SIGINT SIGTERM
sleep infinity & wait