lgq
2025-11-18 956f10584a109456c1bb8c72c9a4e02494812c03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# 批量配置设备转义信息
#
echo -en "Content-type: text/html; charset=utf-8\n\n"
#*****************************************************
source ../bin/env.sh
db="../bin/db"
jsoner="../bin/jsoner"
msg="../bin/msg"
dbFile="/work/iot_cfg.db"
 
 
read content
 
#echo $content > log
 
startChn=`$jsoner $content passcode0`
if [ $? -ne 0 ]
then
    echo "{\"code\": \"error\"}" 
    exit
fi
endChn=`$jsoner $content passcode1`
if [ $? -ne 0 ]
then
    echo "{\"code\": \"error\"}" 
    exit
fi
 
ids=`$jsoner $content devIds`
if [ $? -ne 0 ]
then
    echo "{\"code\": \"error\"}" 
fi
 
 
dictType=`$jsoner $content dictType`
if [ $? -eq 0 ]
then
    sqlite3 $dbFile "update escape set dictType=$dictType where id in ($ids) and passcode>=$startChn and passcode<=$endChn"
    if [ $? -ne 0 ]
    then
        echo "{\"code\": \"error\"}"
        echo "dictType exec error " >> log
        exit
    fi
fi
 
echo "{\"code\": \"success\"}"