script for ping the host
January 31, 2011 at 7:31 am | Posted in shell script | Leave a comment#!/bin/bash
# Script for check ping packet
for myHost in $(cat ip.txt)
do
ping -c 4 $myHost>/dev/null;
count=$(echo $?)
if [ $count -eq 0 ]; then
echo “Host $myHost is UP”
else
echo “Host $myHost is DOWN”
fi
done
Advertisement
Leave a Comment »
RSS feed for comments on this post. TrackBack URI
Leave a Reply
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.