fresh.sh.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. fresh.sh
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='flash.sh.html' title=' flash.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='hardware.sh.html' title=' hardware.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/fresh.sh
  23. # ====================================================================
  24. # symbols;
  25. # --------------------------------------------------------------------
  26. . ${SCRIPTS}/hardware.sh
  27. . ${SCRIPTS}/firmware.sh
  28. # ====================================================================
  29. # confirm connection;
  30. # --------------------------------------------------------------------
  31. echo -n &quot;Interface [${ETH}]: &quot;; read
  32. if [ ! -z ${REPLY} ]; then
  33. ETH=${REPLY}
  34. fi
  35. # ====================================================================
  36. # check connection;
  37. # --------------------------------------------------------------------
  38. int6kwait -xqsi ${ETH}
  39. if [ ${?} != 0 ]; then
  40. echo &quot;Device is not connected&quot;
  41. exit 1
  42. fi
  43. # ====================================================================
  44. # fetch device identity;
  45. # --------------------------------------------------------------------
  46. MAC=$(int6kid -i ${ETH} -A)
  47. DAK=$(int6kid -i ${ETH} -D)
  48. NMK=$(int6kid -i ${ETH} -M)
  49. # ====================================================================
  50. # confirm address;
  51. # --------------------------------------------------------------------
  52. # echo -n &quot;MAC Address [${MAC}]: &quot;; read
  53. # if [ ! -z ${REPLY} ]; then
  54. # MAC=&quot;${REPLY}&quot;
  55. # fi
  56. # ====================================================================
  57. # edit PIB;
  58. # --------------------------------------------------------------------
  59. modpib -M ${MAC} -D ${DAK} -N ${NMK} ${PIB}
  60. if [ ${?} != 0 ]; then
  61. exit 1
  62. fi
  63. # ====================================================================
  64. # erase NVRAM;
  65. # --------------------------------------------------------------------
  66. int6kp -xi ${ETH} -D ${DAK} -X
  67. if [ ${?} != 0 ]; then
  68. exit 1
  69. fi
  70. # ====================================================================
  71. # start firmware;
  72. # --------------------------------------------------------------------
  73. int6kf -xi ${ETH} -C ${CFG} -P ${PIB} -N ${NVM}
  74. if [ ${?} != 0 ]; then
  75. exit 1
  76. fi
  77. # ====================================================================
  78. # define final firmware;
  79. # --------------------------------------------------------------------
  80. PIB=${FIRMWARE}/v3.3.0.pib
  81. NVM=${FIRMWARE}/v3.3.0-0-5-B-FINAL.nvm
  82. # ====================================================================
  83. # download firmware then force flash device;
  84. # --------------------------------------------------------------------
  85. int6k -xi ${ETH} -P ${PIB} -N ${NVM} -FF
  86. if [ ${?} != 0 ]; then
  87. exit 1
  88. fi
  89. # ====================================================================
  90. # return success;
  91. # --------------------------------------------------------------------
  92. exit 0
  93. </pre>
  94. <div class='footerlink'>
  95. [<a href='flash.sh.html' title=' flash.sh '>PREV</a>]
  96. [<a href='toolkit.html' title=' Index '>HOME</a>]
  97. [<a href='hardware.sh.html' title=' hardware.sh '>NEXT</a>]
  98. </div>
  99. </body>
  100. </html>