Skip to content

Instantly share code, notes, and snippets.

@dedworks
dedworks / gluetun-mullvad-rotate
Last active July 2, 2026 20:03
gluetun-mullvad-rotate: Automate randomly choosing a Mullvad VPN server based on SERVER_CITIES variable in docker_compose.yml
#!/bin/bash
# Depends: jq (https://stedolan.github.io/jq/)
default_compose="/docker/compose/gluetun/docker-compose.yml"
compose="${1:-$default_compose}"
relays_url="https://api.mullvad.net/www/relays/all/"
fail() { printf "%s: %s\n" "$0" "$*"; exit 1; }
read_var() {