mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复任务命令中的&和引号
This commit is contained in:
+6
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user