add function:upload and download device file ,modify interface function fix memleak

This commit is contained in:
lnk
2026-03-12 15:28:17 +08:00
parent d1ed49412c
commit 0acc58bbe1
8 changed files with 980 additions and 202 deletions

View File

@@ -51,11 +51,13 @@ kill_process_by_name() {
if [ -n "$PID" ]; then
echo "Found process '$PROCESS_NAME' with PID: $PID"
echo "Killing process..."
kill -9 $PID
if [ $? -eq 0 ]; then
echo "Process '$PROCESS_NAME' killed successfully."
else
echo "Failed to kill the process '$PROCESS_NAME'."
kill -15 $PID
sleep 3
PID2=$(ps -ef | grep "$PROCESS_NAME" | grep -v "grep" | awk '{print $2}')
if [ -n "$PID2" ]; then
echo "Process still exists, force kill: $PID2"
kill -9 $PID2
fi
else
echo "Process '$PROCESS_NAME' not found."
@@ -86,7 +88,7 @@ handle_reset() {
kill_process_by_name "/FeProject/bin/pt61850netd_pqfe -d cfg_soe_comtrade"
#关闭进程后等待一段时间,防止端口占用
#sleep 5
sleep 1
# 清空 runtime.cf 中的所有进程配置
sed -i '/cfg_stat_data/d' /home/pq/FeProject/etc/runtime.cf
@@ -119,6 +121,9 @@ handle_reset() {
sed -i "2a\\$(printf '/FeProject/bin/ ^ pt61850netd_pqfe -d cfg_soe_comtrade^ ^ ^ 1 ^ ^\n')" /home/pq/FeProject/etc/runtime.cf
fi
# 修改后等一下
sleep 1
# 确保文件已被写入并刷新
sync