start.sh.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. start.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='replace-softloader.sh.html' title=' replace-softloader.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='tr069prog.sh.html' title=' tr069prog.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/start.sh
  23. # use int6kf to start firmware on a device having a blank or corrupted
  24. # NVRAM; this is a standard Intellon script that has proven useful but
  25. # feel free to make changes;
  26. # ====================================================================
  27. # host symbols;
  28. # --------------------------------------------------------------------
  29. . /etc/enfironment
  30. . ${SCRIPTS}/hardware.sh
  31. . ${SCRIPTS}/firmware.sh
  32. # ====================================================================
  33. # query connection;
  34. # --------------------------------------------------------------------
  35. echo -n &quot;Interface [${ETH}]: &quot;; read
  36. if [ ! -z ${REPLY} ]; then
  37. ETH=${REPLY}
  38. fi
  39. # ====================================================================
  40. # define random DAK and NMK;
  41. # --------------------------------------------------------------------
  42. MAC=auto
  43. DAK=$(rkey secret.key -D)
  44. NMK=$(rkey secret.key -M)
  45. # ====================================================================
  46. # update PIB file with MAC, DAK and NMK;
  47. # --------------------------------------------------------------------
  48. modpib -M ${MAC} -D ${DAK} -N ${NMK} ${PIB} -v
  49. if [ ${?} != 0 ]; then
  50. exit 1
  51. fi
  52. # ====================================================================
  53. # write CFG, FW and PIB to device and start FW execution;
  54. # --------------------------------------------------------------------
  55. int6kf -i ${ETH} -C ${CFG} -P ${PIB} -N ${NVM}
  56. if [ ${?} != 0 ]; then
  57. exit 1
  58. fi
  59. # ====================================================================
  60. # confirm device identity;
  61. # --------------------------------------------------------------------
  62. int6k -i ${ETH} -I
  63. # ====================================================================
  64. #
  65. # --------------------------------------------------------------------
  66. exit 0
  67. </pre>
  68. <div class='footerlink'>
  69. [<a href='replace-softloader.sh.html' title=' replace-softloader.sh '>PREV</a>]
  70. [<a href='toolkit.html' title=' Index '>HOME</a>]
  71. [<a href='tr069prog.sh.html' title=' tr069prog.sh '>NEXT</a>]
  72. </div>
  73. </body>
  74. </html>