flashp.sh.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. flashp.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='firmware.sh.html' title=' firmware.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='flash.sh.html' title=' flash.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/flashp.sh
  23. # use the int6kfp to initialize an INT6300 device having a blank or
  24. # corrupted NVRAM; the Bootloader must be running for this script to
  25. # work properly;
  26. # ====================================================================
  27. # host symbols;
  28. # --------------------------------------------------------------------
  29. . ${SCRIPTS}/hardware.sh
  30. . ${SCRIPTS}/firmware.sh
  31. # ====================================================================
  32. # confirm connection;
  33. # --------------------------------------------------------------------
  34. echo -n &quot;Interface [${ETH}]: &quot;; read
  35. if [ ! -z ${REPLY} ]; then
  36. ETH=${REPLY}
  37. fi
  38. # ====================================================================
  39. # check connection;
  40. # --------------------------------------------------------------------
  41. int6kwait -xqsi ${ETH}
  42. if [ ${?} != 0 ]; then
  43. echo &quot;Device is not connected&quot;
  44. exit 1
  45. fi
  46. # ====================================================================
  47. # randomize identity;
  48. # --------------------------------------------------------------------
  49. MAC=auto
  50. DAK=$(rkey secret.key -D)
  51. NMK=$(rkey secret.key -M)
  52. # ====================================================================
  53. # confirm address;
  54. # --------------------------------------------------------------------
  55. echo -n &quot;MAC [${MAC}]: &quot;; read
  56. if [ ! -z ${REPLY} ]; then
  57. MAC=&quot;${REPLY}&quot;
  58. fi
  59. echo -n &quot;DAK [${DAK}]: &quot;; read
  60. if [ ! -z ${REPLY} ]; then
  61. DAK=&quot;${REPLY}&quot;
  62. fi
  63. echo -n &quot;NMK [${NMK}]: &quot;; read
  64. if [ ! -z ${REPLY} ]; then
  65. NMK=&quot;${REPLY}&quot;
  66. fi
  67. # ====================================================================
  68. # modify PIB;
  69. # --------------------------------------------------------------------
  70. modpib -M ${MAC} -D ${DAK} -N ${NMK} ${PIB} -v
  71. if [ ${?} != 0 ]; then
  72. exit 1
  73. fi
  74. # ====================================================================
  75. # flash NVRAM with firmware and factory PIB;
  76. # --------------------------------------------------------------------
  77. int6kfp -i ${ETH} -C ${CFG} -P ${PIB} -N ${NVM} -D ${DAK} -FF
  78. if [ ${?} != 0 ]; then
  79. exit 1
  80. fi
  81. # ====================================================================
  82. # confirm identity;
  83. # --------------------------------------------------------------------
  84. int6k -i ${ETH} -I
  85. # ====================================================================
  86. # return success;
  87. # --------------------------------------------------------------------
  88. exit 0
  89. </pre>
  90. <div class='footerlink'>
  91. [<a href='firmware.sh.html' title=' firmware.sh '>PREV</a>]
  92. [<a href='toolkit.html' title=' Index '>HOME</a>]
  93. [<a href='flash.sh.html' title=' flash.sh '>NEXT</a>]
  94. </div>
  95. </body>
  96. </html>