#!/usr/bin/env zsh # Find the default route default_route="$(ip route | grep '^default' | grep -Po '(?<=via )[^ ]+')" if (( ${?} != 0 )); then printf '\e[91merror\e[m: could not get default route\n' exit 1 fi # Reverse lookup the default route (idk why, it works sometimes) login_addr="$(mullvad-exclude host "${default_route}" "${default_route}" | awk 'NR==6 { print $4 }')" if (( ${?} != 0)); then login_addr="${default_route}" fi exec mullvad-exclude firejail --dns="${default_route}" \ firefox --new-instance --no-remote "${login_addr}"