usbUpgrade.sh 881 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/#!/bin/sh
  2. ## check for binary file on USB drive, if it exists, install it
  3. binFile="oboo.bin"
  4. logFile="upgrade.log"
  5. usbPath="/tmp/mounts/USB-A1"
  6. tmpPath="/tmp"
  7. if [ "${ACTION}" = "add" ]; then
  8. sleep 4
  9. MAC=`cat /sys/class/net/ra0/address`
  10. if grep -Fxq "$MAC" $usbPath/$logFile
  11. then
  12. #echo "Device exist, do not upgrade" >> $usbPath/$logFile
  13. exit 0
  14. else
  15. echo $MAC >> $usbPath/$logFile
  16. fi
  17. #echo "Continue with FW upgrade !" >> $usbPath/$logFile
  18. if [ -e $usbPath/$binFile ]; then
  19. # update the display
  20. cat /usr/bin/img/img_upgrade.bin > /dev/fb0
  21. # copy the binary file
  22. cp $usbPath/$binFile $tmpPath/$binFile
  23. # start the upgrade
  24. sysupgrade -n -v $tmpPath/$binFile &
  25. fi
  26. fi