Adds nameserver and site status i3 blocks

This commit is contained in:
Jonathan Hodgson 2018-07-07 13:50:23 +01:00
parent fb6d100ed9
commit cc7d40e293
3 changed files with 38 additions and 0 deletions

18
i3/blocks/nameservers Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/sh
#drill ns racingblue.com | sed -ne '/ANSWER SECTION/,/AUTHORITY SECTION/ p'
case $BLOCK_BUTTON in
1)
echo "HI"
echo "HI"
echo ""
exit 0
;;
esac
NAMESERVERS=$(drill ns "$1" | sed -ne '/ANSWER SECTION/,/AUTHORITY SECTION/ p' | head -n -2 | tail -n +2 | awk '{ print $5" " }' | xargs echo)
echo "$NAMESERVERS"
echo "$NAMESERVERS"
echo ""

10
i3/blocks/siteStatus Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
echo "$1"
echo "$1"
curl "$1" 2> /dev/null | grep -q "$2"
if [ $? -eq 0 ]; then
echo "#00FF00"
else
echo "#FF8000"
fi