取消抹除打開還原預設值功能
#ifdef DEBUG_TEST
cprintf("reset count = %d\n", count);
#else
if (count >= 3) {
//eval("mtd-erase", "-d", "nvram");
nvram_set("restore_defaults", "1");
nvram_commit();
sync();
reboot(RB_AUTOBOOT);
}
else {
led(LED_DIAG, 1);
set_action(ACT_REBOOT);
kill(1, SIGTERM);
}
exit(0);
#endif
2.檔案"release/src-rt/router/httpd/config.c"
取消抹除打開還原預設值功能
3.檔案"release/src-rt/router/httpd/upgrade.c"
取消抹除打開還原預設值功能
2.檔案"release/src-rt/router/httpd/config.c"
取消抹除打開還原預設值功能
void wo_defaults(char *url)
{
const char *v;
int mode;
if ((v = webcgi_get("mode")) != NULL) {
mode = atoi(v);
if ((mode == 1) || (mode == 2)) {
prepare_upgrade();
parse_asp("reboot-default.asp");
web_close();
// disconnect ppp - need this for PPTP/L2TP/PPPOE to finish gracefully
killall("xl2tpd", SIGTERM);
killall("pppd", SIGTERM);
led(LED_DIAG, 1);
sleep(2);
if (mode == 1) {
// eval(NVRAMCMD, "defaults", "--yes");
nvram_set("restore_defaults", "1");
nvram_commit();
}
else {
//eval("mtd-erase", "-d", "nvram");
nvram_set("restore_defaults", "1");
nvram_commit();
}
set_action(ACT_REBOOT);
// kill(1, SIGTERM);
reboot(RB_AUTOBOOT);
exit(0);
}
}
redirect("/admin-config.asp");
}
3.檔案"release/src-rt/router/httpd/upgrade.c"
取消抹除打開還原預設值功能
ERROR2:
rboot = 1;
if (f) fclose(f);
if (pid != -1) waitpid(pid, &n, 0);
if (error == NULL && reset) {
set_action(ACT_IDLE);
//eval("mtd-erase", "-d", "nvram");
nvram_set("restore_defaults", "1");
nvram_commit();
}
set_action(ACT_REBOOT);
resmsg_fread("/tmp/.mtd-write");
web_eat(len);
return;
沒有留言:
張貼留言