Skip to content

Instantly share code, notes, and snippets.

@cimm
Created March 26, 2018 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cimm/6fb983f0c17c5c16bdf7eac81ad449d4 to your computer and use it in GitHub Desktop.
Save cimm/6fb983f0c17c5c16bdf7eac81ad449d4 to your computer and use it in GitHub Desktop.
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