[uname_bornes.sh] parrallélisation

*gruik* *gruik* *gruik*

darcs-hash:20090616012916-bd074-28ee58c4c9f4e06c50eb4752219e74a56bfa5be6.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-06-16 03:29:16 +02:00
parent aeeb314968
commit 6955bd08f3

View file

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
# copyright 2009: Antoine Durand-Gasselin <adg@crans.org>
# license: BSD 3-clauses
if [[ $# -gt 1 ]]; then if [[ $# -gt 1 ]]; then
cat <<EOF cat <<EOF
@ -8,9 +10,14 @@ EOF
exit 1 exit 1
fi 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}'); grep -v '138.231.148.1$' | awk '{print $1}');
do do
printf '%-15s' ${borne/.wifi.crans.org/} ssh ${borne/.crans.org/} -o Connecttimeout=1 "printf '%-15s%s\n' ${borne/.wifi.crans.org/}1 \"\`uname -v\`\"" & pids="$pids $!"
ssh ${borne/.crans.org/} -o Connecttimeout=1 uname -v sleep 0.001 # pour que les bornes sortent dans l'ordre
done done
for pid in $pids; do
wait $pid
done) | sort