Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- trap 'exit' INT
- red="$1"
- base=$(echo "$red" | cut -d'.' -f1-3)
- for ip in $(seq 1 254); do
- host="$base.$ip"
- if ping -c 1 -W 1 "$host" > /dev/null 2>&1; then
- echo "$host ONLINE"
- else
- echo "$host OFFLINE"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment