Files
StateGrid/other_shell/check_date
Qin Bo 2235771f09 Initial commit
Signed-off-by: Qin Bo <bqin@linx-info.com>
2014-02-19 09:07:55 +08:00

31 lines
535 B
Bash

#!/bin/bash
# author:xwang@linx-info.com
my_host=`hostname`
cur_dir=`pwd`
cur_date=`date "+%y-%m-%d_%H_%M_%S"`
Nlst=${HOME}/conf/deliver_hosts_linux.sys
if [ -f $HOME/connect-list ];then
rm $HOME/connect-list
fi
if [ "$1" != "" ];then
Nlst=$1
fi
trap 'exit' 2
for i in `cat $Nlst`
do
ping -c 1 -w 1 $i > /dev/null
if [ $? -gt 0 ];then
echo "ping $i failed,please check your line.."
else
echo "Host:$i"
ssh $i date 2> /dev/null
echo $i >> ${HOME}/connect-list
fi
done