Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. while IFS=: read -r ip ports; do
  2. savIFS=$IFS
  3. IFS=,; set -f; set -- $ports
  4. for port
  5. do
  6. nc "$ip" "$port" 1>/dev/null 2>&1
  7. case $? in
  8. 0 ) status="PASS" ;;
  9. * ) status="FAIL" ;;
  10. esac
  11. echo "$ip:$port - $status"
  12. done
  13. IFS=$savIFS
  14. done < ips.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement