Replace nameservers block with dns block that can do multiple types of dns lookup

master
Jonathan Hodgson 6 years ago
parent 4bfc274bf7
commit 7368c0e061
  1. 33
      i3/blocks/dns
  2. 18
      i3/blocks/nameservers

@ -0,0 +1,33 @@
#!/usr/bin/sh
case $BLOCK_BUTTON in
1)
echo "HI"
echo "HI"
echo ""
exit 0
;;
esac
LOOKUP="a"
if [ ! -z "$2" ]; then
LOOKUP="$2"
fi
COLOR=""
NAMESERVERS=$(drill "$LOOKUP" "$1" | sed -ne '/ANSWER SECTION/,/AUTHORITY SECTION/ p' | head -n -2 | tail -n +2 | awk '{ print $5" " }' | xargs echo)
if [ ! -z "$3" ]; then
if [ "$NAMESERVERS" = "$3" ]; then
COLOR="#00FF00"
else
COLOR="#FF8000"
fi
fi
echo "$NAMESERVERS"
echo "$NAMESERVERS"
echo "$COLOR"

@ -1,18 +0,0 @@
#!/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 ""
Loading…
Cancel
Save