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