Add alias to toggle wg0 interface

This commit is contained in:
Erin 2023-01-18 13:19:18 -05:00
parent 1a6d9563f4
commit c9acb2bf4b

View file

@ -23,3 +23,13 @@ export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# User program: add 1password SSH utils # User program: add 1password SSH utils
export PATH="$HOME/.1password-ssh-utils/bin:$PATH" export PATH="$HOME/.1password-ssh-utils/bin:$PATH"
alias ssh="op-ssh-fetch -n && ssh" alias ssh="op-ssh-fetch -n && ssh"
# User program: make `wg-quick up wg0` less of a pain
function systemctl_toggle {
if systemctl is-active --quiet $1; then
sudo systemctl stop $1
else
sudo systemctl start $1
fi
}
alias wg0="systemctl_toggle wg-quick@wg0.service"