Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/usr/local/bin/bash
  2.  
  3. col1="\x1b[0;31;40m"
  4. col2="\x1b[0;32;40m"
  5. col3="\x1b[0;33;40m"
  6. col4="\x1b[0;36;40m"
  7. col5="\x1b[0;35;40m"
  8.  
  9. # edit this line
  10. cachefile='/usr/local/share/cache'
  11.  
  12. printf "$col1 Hostnames for $HOSTNAME:\n"
  13.  
  14. while read ip host
  15. do
  16. ((++i == 1)) && max="$ip" && continue
  17. [[ -z $host ]] && host="$col5 reverse lookup failed ._."
  18. printf "$col2%-*s $col3= $col4$host\n" "$max" "$ip"
  19. done < "$cachefile"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement