增加运行指定命令接口

This commit is contained in:
whyour
2023-05-01 14:28:58 +08:00
parent df1addc1ff
commit aab6bbeb15
7 changed files with 124 additions and 25 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ update_cron() {
code=$(echo "$api" | jq -r .code)
message=$(echo "$api" | jq -r .message)
if [[ $code != 200 ]]; then
echo -e "\n## 更新任务状态失败(${message})\n" >>$dir_log/$log_path
echo -e "\n## 更新任务状态失败(${message})\n"
fi
}
+1 -1
View File
@@ -89,7 +89,7 @@ check_server() {
## 正常运行单个脚本,$1:传入参数
run_normal() {
local file_param=$1
if [[ $# -eq 1 ]]; then
if [[ $# -eq 1 ]] && [[ "$real_time" != "true" ]]; then
random_delay "$file_param"
fi
+9 -1
View File
@@ -43,7 +43,11 @@ handle_log_path() {
fi
local suffix=""
if [[ ! -z $ID ]]; then
suffix="_${ID}"
if [[ "$ID" -gt 0 ]] 2>/dev/null; then
suffix="_${ID}"
else
ID=""
fi
fi
time=$(date "+$mtime_format")
@@ -66,6 +70,10 @@ handle_log_path() {
if [[ "$show_log" == "true" ]]; then
cmd="2>&1 | tee -a $dir_log/$log_path"
fi
if [[ "$real_time" == "true" ]]; then
cmd=""
fi
}
format_params() {