doit.sh 748 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. if [ $# -gt 0 ]; then
  3. for h in $*; do
  4. hosts="$hosts `dig +short +search $h`"
  5. done
  6. else
  7. hosts=`awk '/^[0-9]+.*# # Linux/ { print $2; }' /usr/local/bb/etc/bb-hosts`
  8. fi
  9. for h in $hosts ; do
  10. echo "$h (`host $h | awk '{print $5;}'`)"
  11. scp /usr/local/operations/linux/evault/Agent-Linux-latest.tar.gz $h:
  12. ssh -qT $h <<EOF
  13. tar zxvpCf /tmp Agent-Linux-latest.tar.gz
  14. (
  15. cd /tmp/Agent+WCC-6.73.3196-Linux-i386-stdc++v3_6
  16. echo n > no
  17. ./install.sh -s -D < no
  18. )
  19. rm -rf /tmp/Agent+WCC-6.73.3196-Linux-i386-stdc++v3_6
  20. rm -f Agent-Linux-latest.tar.gz
  21. EOF
  22. done