소스 검색

snmp变量搞错,改正
改批量打包脚本

guohui 2 년 전
부모
커밋
bd2ad09312
3개의 변경된 파일과 6개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 0
      output/push2/push.bat
  2. 1 1
      output/push2/tools/script.sh
  3. 3 3
      pro/src/sqlite_handle.c

+ 2 - 0
output/push2/push.bat

@@ -50,3 +50,5 @@ IF %ERRORLEVEL% EQU 0 (
     ECHO exec bash failed!
     ECHO exec bash failed!
     EXIT /B 2
     EXIT /B 2
 )
 )
+
+EXIT /B 0

+ 1 - 1
output/push2/tools/script.sh

@@ -61,7 +61,7 @@ rm_old
 echo release $obj ... 
 echo release $obj ... 
 tar -xpf  $tmpdir/pdutar  -C  /  >/dev/null  2>&1
 tar -xpf  $tmpdir/pdutar  -C  /  >/dev/null  2>&1
 if [ -e $tmpdir/logo.png ]; then
 if [ -e $tmpdir/logo.png ]; then
-    cp -rf $tmpdir/logo.png /root/run/app/
+    cp -rf $tmpdir/logo.png /root/run/app/image/
 fi
 fi
 if [ -e $tmpdir/smartPDU.ini ]; then
 if [ -e $tmpdir/smartPDU.ini ]; then
     cp -rf $tmpdir/smartPDU.ini /root/run/app/
     cp -rf $tmpdir/smartPDU.ini /root/run/app/

+ 3 - 3
pro/src/sqlite_handle.c

@@ -2996,7 +2996,7 @@ int dev_get_snmp_info(sqlite3 *db, SNMPManager* _globalSNMPInfo)
     _globalSNMPInfo->mode = atoi(pResult[rowIndex*ncolumn+2]); 
     _globalSNMPInfo->mode = atoi(pResult[rowIndex*ncolumn+2]); 
     strcpy(_globalSNMPInfo->public,pResult[rowIndex*ncolumn+3]);
     strcpy(_globalSNMPInfo->public,pResult[rowIndex*ncolumn+3]);
     _globalSNMPInfo->trapmode = atoi(pResult[rowIndex*ncolumn+4]);
     _globalSNMPInfo->trapmode = atoi(pResult[rowIndex*ncolumn+4]);
-    if(_globalSNMPInfo->mode==2) {
+    if(_globalSNMPInfo->version==2) {
         if(pResult[rowIndex*ncolumn+5]) strcpy(_globalSNMPInfo->crypt.user,pResult[rowIndex*ncolumn+5]);
         if(pResult[rowIndex*ncolumn+5]) strcpy(_globalSNMPInfo->crypt.user,pResult[rowIndex*ncolumn+5]);
         if(pResult[rowIndex*ncolumn+6]) strcpy(_globalSNMPInfo->crypt.auth.alg,pResult[rowIndex*ncolumn+6]);
         if(pResult[rowIndex*ncolumn+6]) strcpy(_globalSNMPInfo->crypt.auth.alg,pResult[rowIndex*ncolumn+6]);
         if(pResult[rowIndex*ncolumn+7]) strcpy(_globalSNMPInfo->crypt.auth.passwd,pResult[rowIndex*ncolumn+7]);
         if(pResult[rowIndex*ncolumn+7]) strcpy(_globalSNMPInfo->crypt.auth.passwd,pResult[rowIndex*ncolumn+7]);
@@ -3020,7 +3020,7 @@ int dev_insert_snmp_info(sqlite3 *db, SNMPManager* _globalSNMPInfo)
     char select_sql[1024] = {0};
     char select_sql[1024] = {0};
 
 
     sprintf(select_sql,"INSERT INTO Table_SNMPManage (product_id, proto_type, enable, public, TrapEnable, "
     sprintf(select_sql,"INSERT INTO Table_SNMPManage (product_id, proto_type, enable, public, TrapEnable, "
-                       "user, auth_alg, auth_passwd, priv_alg, priv_passwd) VALUES (%d,%d,%d,'%s',%d,'%s',%s,'%s',%s,'%s');",
+                       "user, auth_alg, auth_passwd, priv_alg, priv_passwd) VALUES (%d,%d,%d,'%s',%d,'%s','%s','%s','%s','%s');",
         _globalSNMPInfo->product_id,
         _globalSNMPInfo->product_id,
         _globalSNMPInfo->version,
         _globalSNMPInfo->version,
         _globalSNMPInfo->mode,
         _globalSNMPInfo->mode,
@@ -3052,7 +3052,7 @@ int dev_update_snmp_info(sqlite3 *db, int product_id, SNMPManager* _globalSNMPIn
     char* err_msg=NULL;
     char* err_msg=NULL;
     char select_sql[1024] = {0};
     char select_sql[1024] = {0};
     sprintf(select_sql,"UPDATE Table_SNMPManage SET proto_type='%d',enable=%d,public='%s',TrapEnable=%d, "
     sprintf(select_sql,"UPDATE Table_SNMPManage SET proto_type='%d',enable=%d,public='%s',TrapEnable=%d, "
-                       "user='%s',auth_alg=%s,auth_passwd='%s',priv_alg=%s,priv_passwd='%s' WHERE product_id=%d;",
+                       "user='%s',auth_alg='%s',auth_passwd='%s',priv_alg='%s',priv_passwd='%s' WHERE product_id=%d;",
         _globalSNMPInfo->version,
         _globalSNMPInfo->version,
         _globalSNMPInfo->mode,
         _globalSNMPInfo->mode,
         _globalSNMPInfo->public,
         _globalSNMPInfo->public,