#!/bin/bash # Check for the existence of the IP list file if [ ! -f "ip_list.txt" ]; then echo "ip_list.txt not found. Please create the file with one IP address per line." exit 1 fi # Read the IP addresses from the file and ping each one while IFS= read -r ip; do ping -c 3 "$ip" # Change the number of pings (3 in this case) as needed done < "ip_list.txt"