mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复任务命令中的&和引号
This commit is contained in:
parent
8f90d3f8ff
commit
802b2d722e
|
@ -232,8 +232,7 @@ run_else() {
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local params=$(echo "$@" | sed 's/ /\" \"/g')
|
$timeoutCmd $which_program $file_param "$@"
|
||||||
$timeoutCmd $which_program $file_param \"$params\"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
## 命令检测
|
## 命令检测
|
||||||
|
|
|
@ -58,6 +58,7 @@ format_params() {
|
||||||
if type timeout &>/dev/null; then
|
if type timeout &>/dev/null; then
|
||||||
timeoutCmd="timeout -k 10s $command_timeout_time "
|
timeoutCmd="timeout -k 10s $command_timeout_time "
|
||||||
fi
|
fi
|
||||||
|
params=$(echo "$@" | sed 's/&/\\&/g')
|
||||||
}
|
}
|
||||||
|
|
||||||
show_log="false"
|
show_log="false"
|
||||||
|
@ -70,10 +71,11 @@ while getopts ":l" opt; do
|
||||||
done
|
done
|
||||||
[[ "$show_log" == "true" ]] && shift $(($OPTIND - 1))
|
[[ "$show_log" == "true" ]] && shift $(($OPTIND - 1))
|
||||||
|
|
||||||
format_params
|
format_params "$@"
|
||||||
define_program "$@"
|
define_program "$params"
|
||||||
handle_log_path "$@"
|
handle_log_path "$params"
|
||||||
eval . $dir_shell/otask.sh "$@" "$cmd"
|
|
||||||
|
eval . $dir_shell/otask.sh "$params" "$cmd"
|
||||||
[[ -f "$dir_log/$log_path" ]] && cat "$dir_log/$log_path"
|
[[ -f "$dir_log/$log_path" ]] && cat "$dir_log/$log_path"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user