修复cron正则匹配

This commit is contained in:
hanhh 2021-06-04 20:49:10 +08:00
parent 8ebe049d82
commit 73642ba11d

View File

@ -135,6 +135,7 @@ add_cron() {
)
cron_name=$(grep "new Env" $file | awk -F "\(" '{print $2}' | awk -F "\)" '{print $1}' | sed 's:^.\(.*\).$:\1:' | head -1)
[[ -z $cron_name ]] && cron_name="$file_name"
[[ -z $cron_line ]] && cron_line=$(grep "cron:" $file | awk -F ":" '{print $2}' | xargs)
[[ -z $cron_line ]] && cron_line="0 6 * * *"
result=$(add_cron_api "$cron_line:$cmd_task $file:$cron_name")
echo -e "$result"