aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-08-15 21:20:23 -0500
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-08-15 21:20:23 -0500
commitf4f87cf6a1bc07876773ea458840b1381e779ba0 (patch)
tree348406440c2bf2dab96b4604ea7c81c7a2140b63 /common
parent0643da5a45f4ea9bcd28352d438c4801b3dcb75f (diff)
add vpn shortcut
Diffstat (limited to 'common')
-rw-r--r--common/zshrc.org17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/zshrc.org b/common/zshrc.org
index bbc2c0e..b7e3e74 100644
--- a/common/zshrc.org
+++ b/common/zshrc.org
@@ -111,3 +111,20 @@ Define the prompt as follows:
#+begin_src sh :tangle ~/.zshrc :mkdirp yes
PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ '
#+end_src
+
+Enable VPN shortcut.
+#+begin_src sh :tangle ~/.zshrc :mkdirp yes
+ if [ "$(uname)" = 'Linux' ] && grep -q 'ID=gentoo' /etc/os-release; then
+ vpn () {
+ if test -f /tmp/vpn.lock; then
+ echo turning off vpn...
+ doas /usr/bin/wg-quick down ca-tor-wg-101
+ rm /tmp/vpn.lock
+ else
+ echo turning on vpn...
+ doas /usr/bin/wg-quick up ca-tor-wg-101
+ touch /tmp/vpn.lock
+ fi
+ }
+ fi
+#+end_src