erase.sh.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. erase.sh
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.1 14:44:01 Oct 24 2013'/>
  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='CM_ENCRYPTED.sh.html' title=' CM_ENCRYPTED.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/erase.sh
  23. # this script erases flash memory only on selected firmware versions;
  24. # ====================================================================
  25. # symbols;
  26. # --------------------------------------------------------------------
  27. . /etc/environment
  28. . ${SCRIPTS}/hardware.sh
  29. . ${SCRIPTS}/firmware.sh
  30. # ====================================================================
  31. # query connection;
  32. # --------------------------------------------------------------------
  33. echo -n &quot;Interface [${ETH}]: &quot;; read
  34. if [ ! -z ${REPLY} ]; then
  35. ETH=${REPLY}
  36. fi
  37. # ====================================================================
  38. # check connection;
  39. # --------------------------------------------------------------------
  40. int6kwait -xqsi ${ETH}
  41. if [ ${?} != 0 ]; then
  42. echo &quot;Device is not connected&quot;
  43. exit 1
  44. fi
  45. # ====================================================================
  46. # read device DAK;
  47. # --------------------------------------------------------------------
  48. DAK=$(int6kid -i ${ETH} -D)
  49. # ====================================================================
  50. # erase NVRAM on local device; only works on some firmware versions;
  51. # --------------------------------------------------------------------
  52. int6kp -i ${ETH} -D ${DAK} -E
  53. if [ ${?} != 0 ]; then
  54. exit 1
  55. fi
  56. # ====================================================================
  57. # return success;
  58. # --------------------------------------------------------------------
  59. exit 0
  60. </pre>
  61. <div class='footerlink'>
  62. [<a href='CM_ENCRYPTED.sh.html' title=' CM_ENCRYPTED.sh '>PREV</a>]
  63. [<a href='toolkit.html' title=' Index '>HOME</a>]
  64. [<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
  65. </div>
  66. </body>
  67. </html>