```
#!/bin/sh
IF=${BLOCK_INSTANCE:-'tun0'}
IF_PATH="/proc/sys/net/ipv4/conf/$IF"
if [ -d $IF_PATH ]; then
ACTION='down'
ACTION_MESSAGE='Disconnecting...'
echo '\n\n#00FF00'
else
ACTION='up'
ACTION_MESSAGE='Connecting...'
echo '\n\n#FF0000'
fi
if [ -n "$1" ] && [ "$BLOCK_BUTTON" = '1' ]; then
CONNECTION="$1"
notify-send -i network-vpn -t 2000 "$CONNECTION" "$ACTION_MESSAGE"
nmcli connection "$ACTION" id "$CONNECTION" &
fi
```
```
[vpn]
label=
command=$HOME/bin/i3blocks/vpn MyVPNConnectionName
instance=tun0
interval=5
```