mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
增加运行指定命令接口
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user