reducing repetitive calls

This commit is contained in:
Siina Mashek 2020-07-04 11:18:53 +03:00 committed by Siina Maček
parent 86b51fc94f
commit 82b155ce80

8
bashrc
View File

@ -16,14 +16,16 @@ dfa() {
} }
vpn() { vpn() {
if [ "$1" == "on" ]; then if [ "$1" == "on" ]; then
doas protonvpn c --p2p cmd="c --p2p"
elif [ "$1" == "off" ]; then elif [ "$1" == "off" ]; then
doas protonvpn d cmd="d"
elif [ "$1" == "status" ]; then elif [ "$1" == "status" ]; then
doas protonvpn s cmd="s"
else else
echo "Please pass an argument: on, off, status" echo "Please pass an argument: on, off, status"
return
fi fi
doas protonvpn "$cmd"
} }
ip_check() { ip_check() {
curl wgetip.net/n curl wgetip.net/n