#!/bin/sh
# 2025-05-13:
# 告警批量处理
#
echo -en "Content-type: text/html; charset=utf-8\n\n"
#*****************************************************
source ../bin/env.sh
db="../bin/db"
jsoner="../bin/jsoner"
msg="/usr/sbin/msg"

read content
time=`$jsoner "$content" processTime`
note=`$jsoner "$content" note`

sqlite3 /work/data/alarm.db "update data set processTime=$time where flag=0" 
sqlite3 /work/data/alarm.db "update data set note=$note where flag=0" 
sqlite3 /work/data/alarm.db "update data set flag=1 where flag=0" 


if [ $? -eq 0 ]
then
	echo "{\"code\": \"success\"}"  
else 
	echo "{\"code\": \"error\"}" 
fi    

#echo "time: $time; note=$note" > log
