Browse Source

Removed duplicate code

master
Josh Wolfe 1 year ago
parent
commit
4b14441d45
1 changed files with 13 additions and 24 deletions
  1. 13
    24
      bin/bin/scan

+ 13
- 24
bin/bin/scan View File

@@ -15,31 +15,20 @@ else
TO=$1
fi

echo -e $ABOLD"DH2020"$ARESET
for i in $(seq -w 0 30); do
if timeout --preserve-status $TO nmap -p22 dh2020pc$i.utm.utoronto.ca -oG - | grep -q 22/open; then
echo -en "$AGREEN""dh2020pc$i""\t"
else
echo -en "$ARED""dh2020pc$i""\t"
fi
for room in "2020" "2026"; do
echo -e $ABOLD"DH$room"$ARESET
for i in $(seq -w 0 30); do
if timeout --preserve-status $TO nmap -p22 -Pn dh"$room"pc"$i".utm.utoronto.ca -oG - | grep -q 22/open; then
echo -en "$AGREEN""dh2020pc$i""\t"
else
echo -en "$ARED""dh2020pc$i""\t"
fi

if [ $((10#$((10#$i+1)) % 3)) == 0 ]; then
echo ""
fi
done

echo -e $ARESET
echo -e "\n"$ABOLD"DH2026"$ARESET
for i in $(seq -w 0 30); do
if timeout --preserve-status $TO nmap -p22 dh2026pc$i.utm.utoronto.ca -oG - | grep -q 22/open; then
echo -en "$AGREEN""dh2026pc$i""\t"
else
echo -en "$ARED""dh2026pc$i""\t"
fi

if [ $((10#$((10#$i+1)) % 3)) == 0 ]; then
echo ""
fi
if [ $((10#$((10#$i+1)) % 3)) == 0 ]; then
echo ""
fi
done
echo -e $ARESET
done

echo -e $ARESET

Loading…
Cancel
Save