17 lines
196 B
Bash
Executable File
17 lines
196 B
Bash
Executable File
#!/bin/bash
|
|
|
|
FILE=$1
|
|
|
|
if [ $# -lt 1 ]
|
|
then
|
|
echo "Syntax: ./$(basename $0) <file name>"
|
|
exit
|
|
fi
|
|
|
|
for host in $(cat ${FILE})
|
|
do
|
|
|
|
ssh -o ConnectTimeout=3 -n root@$host "hostname && uptime "
|
|
|
|
done
|