15 lines
		
	
	
		
			392 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			392 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # Actually works for Wireguard
 | |
| # we are connected if the directory exists
 | |
| if [ -d /proc/sys/net/ipv4/conf/wg0 ]; then
 | |
|   # we are connected, so propose disconnexion
 | |
|   echo "Disconnect VPN"
 | |
|   sudo wg-quick down wg0 
 | |
| else
 | |
|   echo "Connect VPN"
 | |
|   sudo wg-quick up wg0
 | |
| fi
 | |
| kill -9 $(ps faux | grep [b]ar_id=2 | awk '{print $2}') 
 | |
| i3-msg -t command 'exec --no-startup-id i3bar --bar_id=2'
 | 
