diff options
author | Tim Keller <tjkeller.xyz> | 2024-11-17 23:39:40 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2024-11-17 23:39:40 -0600 |
commit | 08f22ad82edbe30606a8145a01ab18f2f6d71b4b (patch) | |
tree | cce5c45c996d81d131ada2f409a3c6d041b5416e /.old/wgconnect | |
parent | 09ada24d4ec23cf24ab136141b354953d1bbc2fa (diff) | |
download | scripts-08f22ad82edbe30606a8145a01ab18f2f6d71b4b.tar.xz scripts-08f22ad82edbe30606a8145a01ab18f2f6d71b4b.zip |
delete .old dir since all is still stored in version control
Diffstat (limited to '.old/wgconnect')
-rwxr-xr-x | .old/wgconnect | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/.old/wgconnect b/.old/wgconnect deleted file mode 100755 index de8f307..0000000 --- a/.old/wgconnect +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Connect to/disconnect from wireguard tunnel using dmenu - -sudo="${SUDO:-sudo}" -pass="$(xsudo --get-pass)" - -ssudo() { echo "$pass" | $sudo $@ ; } - -dmenu_confirm_continue() { - case "$(echo "yes\nno" | dmenu -p "$1")" in - yes) - ;; - *) exit 0 ;; - esac -} - -curtun="$(ssudo wg show | sed 's/interface: //;q')" - -# Ask to disconnect from current interface -if [ -n "$curtun" ]; then - dmenu_confirm_continue "Currently connected to tunnel $curtun. Disconnect?" - - output="$(ssudo wg-quick down "$curtun" 2>&1)" - notify-send "Disconnected from $curtun" "$output" - - dmenu_confirm_continue "Connect to another interface?" -fi - -# Connect to new interface -tundir=/etc/wireguard - -tun="$tundir/$(ssudo ls "$tundir" | grep "\.conf$" | dmenu -p "Connect to which tunnel?")" - -if ! ssudo cat $tun >/dev/null 2>/dev/null; then - notify-send "Couldn't connect to tunnel $tun" - exit 1 -fi - -output="$(ssudo wg-quick up "$tun" 2>&1)" -notify-send "Connected to $tun" "$output" |