Sfoglia il codice sorgente

1、暂时屏蔽重启agent(重启反而导致snmp通讯失败)
2、微调恢复出厂设置接口

guohui 2 anni fa
parent
commit
f21e33fe9e
2 ha cambiato i file con 11 aggiunte e 12 eliminazioni
  1. 2 1
      pro/src/app.c
  2. 9 11
      pro/src/sys.c

+ 2 - 1
pro/src/app.c

@@ -1854,7 +1854,8 @@ int snmp_config(SNMPManager *m)
         system(cmd);
     }
     system("/etc/init.d/S90PDUApp restart snmpd");
-    thread_restart(THREAD_ID_SNMP);
+    //exit(0);
+    //thread_restart(THREAD_ID_SNMP);
 
     return 0;
 }

+ 9 - 11
pro/src/sys.c

@@ -138,7 +138,7 @@ int sys_set_factory(void)
 
     snprintf(src, sizeof(src), "%s/%s", dir, DATABASE_BAK_NAME);
     snprintf(dst, sizeof(dst), "%s/%s", dir, DATABASE_NAME);
-    LOGD("___ file_copy from %s to %s\n", src, dst);
+    LOGD("__1__ file_copy from %s to %s\n", src, dst);
     r = file_copy(dst, src);
 
     if(0) {
@@ -148,22 +148,20 @@ int sys_set_factory(void)
         snprintf(src, sizeof(src), "%s/%s", dir, INI_FILE_BAK_NAME);
         snprintf(dst, sizeof(dst), "%s/%s", dir, INI_FILE_NAME);
 
-        LOGD("___ file_copy from %s to %s\n", src, dst);
+        LOGD("__2__ file_copy from %s to %s\n", src, dst);
         r = file_copy(dst, src);
     }
 
-    if(r==0) {
 #if 0
-        r = set_net(&DFLT_PARAS.dev._network_info, IP_V4);
-        if(r) {
-            LOGE("____ set_net failed\n");
-            return -1;
-        }
+    r = set_net(&DFLT_PARAS.dev._network_info, IP_V4);
+    if(r) {
+        LOGE("____ set_net failed\n");
+        return -1;
+    }
 #endif
 
-        LOGD("____ exit smartPDU now ...\n");
-        exit(0);
-    }
+    LOGD("____ exit smartPDU now ...\n");
+    exit(0);
 
     return r;
 }