Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ "$1" == "" ]
  4. then
  5. echo "Usage: ./pingsweep.sh [network]"
  6. echo "Exmaple: ./pingsweep.sh 192.168.1"
  7. else
  8. for ip in `seq 1 254`; do
  9. ping -c 1 $1.$ip | grep "64 bytes" | cut -d ' ' -f 4 | sed 's/.$//' &
  10. done
  11. fi
  12.  
  13. #!/bin/bash
  14.  
  15. if [ "$1" == "" ]
  16. then
  17. echo "Usage: ./pingsweep.sh [ip list txt]"
  18. echo "Exmaple: ./pingsweep.sh list.txt"
  19. else
  20. for ip in `cat $1`; do
  21. ping -c 1 $ip | grep "64 bytes" | cut -d ' ' -f 4 | sed 's/.$//' &
  22. done
  23. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement