2021-03-31 19:34:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# select and active wireguard interface; requires sudo
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-04-02 19:52:43 +00:00
|
|
|
if [[ $EUID > 0 ]]; then
|
2021-03-31 19:34:50 +00:00
|
|
|
echo "requires administrative privileges"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
defaultquery="es1"
|
|
|
|
conffile=$(find /etc/wireguard -type f -name '*.conf' | sort | fzf -q "$defaultquery")
|
|
|
|
config=$(basename "$conffile" ".conf")
|
|
|
|
wg-quick up "$config"
|