My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scan 935B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. ARESET="\e[0m"
  3. ABOLD="\e[1m"
  4. AGREEN="\e[32m"
  5. ARED="\e[91m"
  6. # Default timeout of 0.25
  7. if [ "$#" -gt 1 ]; then
  8. echo "Usage: $0 [timeout]"
  9. exit 1
  10. elif [ "$#" -eq 0 ]; then
  11. TO=0.5
  12. else
  13. TO=$1
  14. fi
  15. echo -e $ABOLD"DH2020"$ARESET
  16. for i in $(seq -w 0 30); do
  17. if timeout --preserve-status $TO nmap -p22 dh2020pc$i.utm.utoronto.ca -oG - | grep -q 22/open; then
  18. echo -en "$AGREEN""dh2020pc$i""\t"
  19. else
  20. echo -en "$ARED""dh2020pc$i""\t"
  21. fi
  22. if [ $((10#$((10#$i+1)) % 3)) == 0 ]; then
  23. echo ""
  24. fi
  25. done
  26. echo -e $ARESET
  27. echo -e "\n"$ABOLD"DH2026"$ARESET
  28. for i in $(seq -w 0 30); do
  29. if timeout --preserve-status $TO nmap -p22 dh2026pc$i.utm.utoronto.ca -oG - | grep -q 22/open; then
  30. echo -en "$AGREEN""dh2026pc$i""\t"
  31. else
  32. echo -en "$ARED""dh2026pc$i""\t"
  33. fi
  34. if [ $((10#$((10#$i+1)) % 3)) == 0 ]; then
  35. echo ""
  36. fi
  37. done
  38. echo -e $ARESET