[uname_bornes.sh] parrallélisation
*gruik* *gruik* *gruik* darcs-hash:20090616012916-bd074-28ee58c4c9f4e06c50eb4752219e74a56bfa5be6.gz
This commit is contained in:
parent
aeeb314968
commit
6955bd08f3
1 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
# copyright 2009: Antoine Durand-Gasselin <adg@crans.org>
|
||||
# license: BSD 3-clauses
|
||||
|
||||
if [[ $# -gt 1 ]]; then
|
||||
cat <<EOF
|
||||
|
@ -8,9 +10,14 @@ EOF
|
|||
exit 1
|
||||
fi
|
||||
|
||||
for borne in $(host -l wifi.crans.org | grep 138.231.148 | \
|
||||
pids=""
|
||||
(for borne in $(host -l wifi.crans.org | grep 138.231.148 | \
|
||||
grep -v '138.231.148.1$' | awk '{print $1}');
|
||||
do
|
||||
printf '%-15s' ${borne/.wifi.crans.org/}
|
||||
ssh ${borne/.crans.org/} -o Connecttimeout=1 uname -v
|
||||
ssh ${borne/.crans.org/} -o Connecttimeout=1 "printf '%-15s%s\n' ${borne/.wifi.crans.org/}1 \"\`uname -v\`\"" & pids="$pids $!"
|
||||
sleep 0.001 # pour que les bornes sortent dans l'ordre
|
||||
done
|
||||
|
||||
for pid in $pids; do
|
||||
wait $pid
|
||||
done) | sort
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue