IGD3000系列(一体屏)网关的app和文件系统的打包目录
lgq
2025-07-19 a7e0c81a31f5cbafaeaf97dab7f08caadadd1257
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
#!/bin/sh
# 手动解除声光报警
echo -en "Content-type: text/html; charset=utf-8\n\n"
#*****************************************************
source ../bin/env.sh
 
echo "{\"code\": \"success\"}"
 
# echo 0 > /usr/local/dev/do1
 
# 原始字符串
str=`sqlite3 /work/iot_cfg.db "select alarm from alarm;"`
 
# 移除逗号,生成连续字符序列
clean_str=${str//,/}
 
# 需要检查的位置列表(1、3、5、7)
positions="0 1 2 3"  # 索引从0开始,对应第1、3、5、7个字符
 
# 遍历位置并判断
for pos in $positions; do
    char="${clean_str:$pos:1}"  # 提取指定位置的字符
    if [[ "$char" == "1" ]]; then
        actual_pos=$((pos + 1))  # 转换为实际位置(从1计数)
        echo 0 > /usr/local/dev/do$actual_pos
    fi
done