blob: 62aab79e756c5fe68c07191a6759f596045b86fc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/env bash
set -e
if [ "$EUID" -eq 0 ]; then
echo "Don't use sudo/root pls"
exit
fi
if ! wg &>/dev/null; then
wg-quick down wg0
echo "Disconnected from Wireguard!"
exit
fi
if sudo pppstats &>/dev/null; then
sudo poff uni-tuebingen
echo "Disconnected from Tübingen!"
exit
fi
read -p "[T]uebingen or [W]ireguard? " -n 1 -r
echo
if [[ $REPLY =~ ^[Tt]$ ]]; then
sudo pon uni-tuebingen
echo "Connected to Tübingen!"
exit
elif [[ $REPLY =~ ^[Ww]$ ]]; then
wg-quick up wg0
echo "Connected to Wireguard!"
exit
fi
|