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() {
if [ "$1" == "on" ]; then
doas protonvpn c --p2p
cmd="c --p2p"
elif [ "$1" == "off" ]; then
doas protonvpn d
cmd="d"
elif [ "$1" == "status" ]; then
doas protonvpn s
cmd="s"
else
echo "Please pass an argument: on, off, status"
return
fi
doas protonvpn "$cmd"
}
ip_check() {
curl wgetip.net/n