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
| #!/bin/sh
| # 端口配置-查询
| echo -en "Content-type: text/html; charset=utf-8\n\n"
| #*****************************************************
| source ../bin/env.sh
| db="../bin/db"
|
| # 文件路径
| FILE="/usr/local/dev/dev.json"
|
| num=`jsoner -g "$FILE" uart`
|
| # 判断文件是否存在且不为空
| if [ -n "$num" ]
| then
| `sqlite3 /work/iot_cfg.db "delete from port where no>'$num'"`
| fi
|
|
| content=`$db query_port`
| if [ $? -eq 0 ]
| then
| echo "$content"
| else
| echo "[]"
| fi
|
| #echo "query db port: $content" > log
|
|
|