Skip to content

Instantly share code, notes, and snippets.

@klaxa
Last active August 29, 2015 14:07
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 klaxa/98b9183fae46f061e1ae to your computer and use it in GitHub Desktop.
Save klaxa/98b9183fae46f061e1ae to your computer and use it in GitHub Desktop.
#!/bin/bash
ping -c 1 -W 2 8.8.8.8 2> /dev/null > /dev/null
ret=$?
if [[ "$ret" -ne "0" ]]
then
#echo \'<span color=\"red\">Offline</span> \'
echo " Offline "
else
#echo \'<span color=\"green\">Online</span> \'
echo " Online"
fi
[...]
local bashets = require("bashets")
[...]
alivewidget = wibox.widget.textbox()
bashets.register("/home/klaxa/Development/shell/gdns_ping.sh", {widget = alivewidget, separator = " ", update_time=3, file_update_time=3, async=true,
format = ' <span color="red">$1</span> <span color="green">$2</span>'})
bashets.start()
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment