Skip to content

Instantly share code, notes, and snippets.

@cimm cimm/vpn-warning.sh
Created Mar 26, 2018

Embed
What would you like to do?
Intended to run in cron, a little nudge to warn me to turn on my VPN
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
if /sbin/ifconfig tun0; then
echo "VPN is active";
else
DISPLAY=:0 notify-send "VPN is not active"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.