完善start脚本,避免重复动态注册

This commit is contained in:
2026-04-03 18:01:33 +08:00
parent db03756946
commit a11aaa18e1
5 changed files with 18 additions and 36 deletions
+12 -4
View File
@@ -2,12 +2,20 @@
echo "start ssh"
service ssh start
# 检查 Prod_connect.json 文件中 user 字段是否包含 $1 参数
if jq --arg param "$1" '(.product.user | split("|") | contains([$param]))' /yuzhen_iot/prod_manage/cfg/Prod_connect.json; then
echo "Parameter $1 found in Prod_connect.json user field. Skipping plumber execution."
FILE_PATH="/yuzhen_iot/prod_manage/cfg/Prod_connect.json"
SEARCH_TERM=$1
if [ -z "$SEARCH_TERM" ]; then
echo "使用错误: 请输入要检查的参数。"
exit 1
fi
if jq -e ".product.user | contains(\"$SEARCH_TERM\")" "$FILE_PATH" > /dev/null; then
echo "包含: 字段 'user' 中找到了 '$SEARCH_TERM'"
else
echo "Parameter $1 not found in Prod_connect.json user field. Starting plumber..."
/yuzhen_iot/prod_manage/app/plumber -project /home/yz_project.csv -S $1
echo "不包含: 字段 'user' 中未找到 '$SEARCH_TERM'"
fi
echo "start scheduler"