first commit
This commit is contained in:
17
scripts/loop_a_function.sh
Normal file
17
scripts/loop_a_function.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
#loop a function
|
||||
|
||||
FILE="../servers"
|
||||
|
||||
uptime_ost ()
|
||||
{
|
||||
for host in $(cat ${FILE})
|
||||
do
|
||||
ssh -o ConnectTimeout=3 -n root@$host "uptime" >> uptime_$host
|
||||
done
|
||||
}
|
||||
|
||||
while true ;do
|
||||
uptime_ost;
|
||||
sleep 5
|
||||
done > /dev/null 2>&1
|
Reference in New Issue
Block a user