Changeset 12358 in genesis for tools


Ignore:
Timestamp:
Jun 13, 2013, 3:22:13 PM (12 years ago)
Author:
rick
Message:

Better connection handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/flash-ns5m

    r12357 r12358  
    66#
    77DIRNAME=`dirname $0`
     8TOTAL_TRIES=60
    89
    910# Argument helpers
     
    3031
    3132# Verify connectivity
    32 ping -c 1 192.168.1.20
    33 if [ $? -ne 0 ]; then
    34   echo "Unable to connect to NanoStation"
    35   exit 1
    36 fi
     33TRY=0
     34while true; do
     35  sshpass -p ubnt ssh -oUserKnownHostsFile=/dev/null ubnt@192.168.1.20 'uname -a'
     36  if [ $? -eq 0 ]; then
     37    break
     38  fi
     39
     40  TRY=`expr $TRY + 1`
     41  echo "Unable to connect to NanoStation (attempt $TRY of $TOTAL_TRIES)"
     42  if [ $TRY -ge $TOTAL_TRIES ]; then
     43    exit 1
     44  fi
     45  sleep 1
     46done
    3747
    3848# Variables needed from Nanostaion, as to be filled into configuration
     
    4454
    4555# Flash node
    46 sshpass -p ubnt scp -oUserKnownHostsFile=/dev/null system.cfg.new fwupdate.bin ubnt@192.168.1.20:/tmp
    47 sshpass -p ubnt ssh -oUserKnownHostsFile=/dev/null ubnt@192.168.1.20 'cfgmtd -w -f /tmp/system.cfg.new && fwupdate -m'
     56sshpass -p ubnt scp -oUserKnownHostsFile=/dev/null system.cfg.new fwupdate.bin ubnt@192.168.1.20:/tmp || exit 1
     57sshpass -p ubnt ssh -oUserKnownHostsFile=/dev/null ubnt@192.168.1.20 'cfgmtd -w -f /tmp/system.cfg.new && fwupdate -m' || exit 1
    4858
    4959echo "Ones the leds are off configuration is done"
Note: See TracChangeset for help on using the changeset viewer.