Changeset c7c0d88 in freewrt
- Timestamp:
- Jul 3, 2007, 7:19:19 PM (18 years ago)
- Children:
- 4c47aa6
- Parents:
- d2b81cc
- Location:
- package/fwwif
- Files:
-
- 3 edited
-
Makefile (modified) (1 diff)
-
extra/fwwif.ecpp (modified) (1 diff)
-
extra/mgmt.ecpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
package/fwwif/Makefile
rd2b81cc rc7c0d88 9 9 PKG_NAME= fwwif 10 10 PKG_VERSION= 20070703 11 PKG_RELEASE= 411 PKG_RELEASE= 5 12 12 NO_DISTFILES= 1 13 13 -
package/fwwif/extra/fwwif.ecpp
rd2b81cc rc7c0d88 82 82 % reply.out() << global_index; 83 83 <li style="list-style:none;"> </li> 84 <li><a href="mgmt?op=commit">commit changes to flash</a> (FWCF)</li> 84 <li><a href="mgmt?op=commit">Commit changes to flash</a> (FWCF)</li> 85 <li><a href="mgmt?op=reload">Reload webinterface</a> (FWWIF)</li> 86 <li><a href="mgmt?op=reboot">Reboot embedded system</a> (FreeWRT)</li> 85 87 <li><a href="version">version information</a> (FWWIF)</li> 86 88 </ul> -
package/fwwif/extra/mgmt.ecpp
rd2b81cc rc7c0d88 53 53 utilname = "fwcf commit"; 54 54 okay = true; 55 } else if (op == "reload") { 56 pageheader = "reload webinterface"; 57 pagetitle_run = "Reloading webinterface"; 58 pagetitle_wrong = "Reload failed"; 59 text_wrong = "Reloading webinterface failed."; 60 pagetitle_ok = "Reloaded successfully"; 61 text_ok = "The webinterface was reloaded."; 62 utilname = "/etc/init.d/fwwif restart"; 63 okay = true; 64 } else if (op == "reboot") { 65 pageheader = "reboot"; 66 pagetitle_run = "Rebooting"; 67 pagetitle_wrong = "Reboot failed"; 68 text_wrong = "Reboot failed."; 69 pagetitle_ok = "Rebooted successfully"; 70 text_ok = "The embedded system was rebooted."; 71 utilname = "/bin/busybox reboot"; 72 okay = true; 55 73 } 56 74 runComp2(header, title, pageheader); … … 61 79 <h1>Management functions</h1> 62 80 <p>Please choose one of the following management functions.</p><ul> 63 <li><a href="mgmt?op=commit">Commit changes to flash (FWCF)</a></li> 64 <li><a href="version">FWWIF Version Information</a></li> 81 <li><a href="mgmt?op=commit">Commit changes to flash</a> (FWCF)</li> 82 <li><a href="mgmt?op=reload">Reload webinterface</a> (FWWIF)</li> 83 <li><a href="mgmt?op=reboot">Reboot embedded system</a> (FreeWRT)</li> 84 <li><a href="version">version information</a> (FWWIF)</li> 65 85 </ul> 66 86 % } else if (really == "yes" && ick && ick == checkpoint) { … … 69 89 <%cpp> 70 90 int i = 0; 71 const char *s;72 91 char *text; 73 74 if (op == "commit") {75 s = "fwcf commit";76 }77 92 78 93 reply.setDirectMode(); // flush output 79 94 80 95 checkpoint = arc4random(); /* prevent re-use */ 81 text = c_exec( s, &i);96 text = c_exec(utilname.c_str(), &i); 82 97 if (i) { 83 98 reply.out() << "<h1>"; … … 101 116 } while (!checkpoint); 102 117 103 if (op == "commit" ) {118 if (op == "commit" || op == "reboot") { 104 119 int i; 105 120 char *changes; 106 121 107 122 changes = c_exec("/sbin/fwcf status", &i); 108 if (changes) {109 123 </%cpp> 124 % if (op == "commit") { 125 <h1>Commit to flash</h1> 126 % } else if (op == "reboot") { 127 <h1>Reboot embedded system</h1> 128 % } 129 % if (changes) { 110 130 <p class="blkbeg">The following files have been modified:</p> 111 131 <pre class="blkmid"><$ *changes ? changes : "No files modified." $></pre> 132 % if (op == "commit") { 112 133 <p class="blkend">Do you really want to commit all these changes 134 into flash to retain them over system reboots?</p> 135 % } else if (op == "reboot") { 136 <p class="blkend">Do you really want to reboot without saving these changes?</p> 137 % } 113 138 % free(changes); 114 139 % } else { 115 <h1>Commit to flash</h1>116 140 <p>Do you really want to commit all changes to <tt>/etc</tt> 141 into flash to retain them over system reboots?</p> 117 142 % } 118 into flash to retain them over system reboots?</p> 143 % } else if (op == "reload") { 144 <h1>Reload the webinterface</h1> 145 <p>Do you really want to stop and restart the webinterface?</p> 146 % } 119 147 <table width="100%"> 120 148 <tr> 121 149 <td> </td> 122 150 <td style="background-color:#00FF00;width:60px;height:32px;font-size:big;text-align:center;"><a 123 href="commit?op= commit&really=yes&ck=<$checkpoint$>">Yes</a></td>151 href="commit?op=<$op$>&really=yes&ck=<$checkpoint$>">Yes</a></td> 124 152 <td style="background-color:#FF0000;width:60px;height:32px;font-size:big;text-align:center;"><a 125 153 href="/">No</a></td> … … 127 155 </tr> 128 156 </table> 129 % }130 157 % } 131 158 <& footer>
Note:
See TracChangeset
for help on using the changeset viewer.
