Changeset 10661 in genesis for tools/batch-cmd


Ignore:
Timestamp:
May 3, 2012, 6:34:41 AM (13 years ago)
Author:
rick
Message:

Some more commands for management.

Related-To: beheer#207

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/batch-cmd

    r10638 r10661  
    1111
    1212echo "# WARN: Going to run at: " $HOSTS; sleep 2
     13scp_files=""
     14concurrent=true
    1315
    1416##
     
    5052
    5153##
    52 ## Sync lvrouted and wl-config files
     54## Sync some files
    5355##
     56#scp_files="/tmp/wl-config /tmp/nameserver-shuffle"
    5457#cat <<'EOF' > /tmp/command
    5558#mount -uwo noatime / || exit 1
     
    5861#
    5962#cp -v /tmp/wl-config /tools || exit 1
    60 #cp -v /tmp/lvrouted.in /usr/local/etc/rc.d/lvrouted || exit 1
    61 #cp -v /tmp/lvrouted.in /conf/base/etc/local/rc.d/lvrouted || exit 1
     63#cp -v /tmp/nameserver-shuffle /tools || exit 1
    6264#
    63 #/usr/local/etc/rc.d/lvrouted rcvar
     65#mount -ur / || exit 1
     66#/tools/wl-config -b || exit 1
     67#/tools/nameserver-shuffle || exit 1
    6468#EOF
    6569
     
    6872## config generator server
    6973##
    70 #cat <<'EOF' > /tmp/command
    71 ##sleep `expr $$ % 120`
    72 #/tools/wl-config -b
    73 #EOF
     74cat <<'EOF' > /tmp/command
     75sleep `expr $$ % 300`
     76/tools/wl-config -b || exit 1
     77/tools/nameserver-shuffle || exit 1
     78EOF
    7479
    7580##
     
    8287##   for F in ip-*.txt; do printf "%-20s : %s\n" `echo "$F" | awk -F'[-.]' '{print $2}'` `grep -v '*' $F | tail -1 | awk '{print $2}'`; done | awk '{print $3}' | sed 's/^2[a-z0-9-]*\.//g' | sort | uniq -c
    8388##
    84 cat << 'EOF' > /tmp/command
    85 traceroute -m 15 -w 1 -q 1 -I rvdzwet.nl
    86 EOF
     89#cat << 'EOF' > /tmp/command
     90#traceroute -m 15 -w 1 -q 1 -I rvdzwet.nl
     91#EOF
    8792
    8893
     
    96101  : > $stdout_file
    97102  : > $stderr_file
    98   {
    99     #scp -o ConnectTimeout=3 -o BatchMode=yes /tmp/wl-config /tmp/lvrouted.in root@$HOST:/tmp || exit 1
     103  if $concurrent; then
     104    {
     105      if [ -n "$scp_files" ]; then
     106         scp -o ConnectTimeout=3 -o BatchMode=yes $scp_files root@$HOST:/tmp || exit 1
     107      fi
     108      cat /tmp/command | ssh -o ConnectTimeout=3 -o BatchMode=yes root@$HOST 'cat >/tmp/command && sh /tmp/command'
     109    } 1>$stdout_file 2>$stderr_file &
     110  else
     111    if [ -n "$scp_files" ]; then
     112       scp -o ConnectTimeout=3 -o BatchMode=yes $scp_files root@$HOST:/tmp || exit 1
     113    fi
    100114    cat /tmp/command | ssh -o ConnectTimeout=3 -o BatchMode=yes root@$HOST 'cat >/tmp/command && sh /tmp/command'
    101   } 1>$stdout_file 2>$stderr_file &
     115  fi
    102116done
    103117
Note: See TracChangeset for help on using the changeset viewer.