bins

handy scripts
git clone git://popovic.xyz/bins.git
Log | Files | Refs | LICENSE

vpn (445B)


      1 #!/usr/bin/zsh
      2 
      3 
      4 start() {
      5 	tmux new-session -d -s vpn_sesh 'sudo openvpn --block-ipv6 --config $XDG_DATA_HOME/openvpn/laptop.ovpn' && pkill -RTMIN+6 dwmblocks
      6     echo 'Connecting...' && notify_me
      7 
      8 }
      9 
     10 stop() {
     11 	pgrep openvpn | xargs sudo kill -9 && tmux kill-session -t vpn_sesh && pkill -RTMIN+6 dwmblocks
     12     echo 'Disconnecting...' && notify_me
     13 
     14 }
     15 
     16 notify_me(){
     17 	sleep 3 &&\
     18     notify-send "VPN" "IPV4 is $(curl --silent l2.io/ip)"
     19 }
     20 
     21 "$@"