From 330bbbe4667b4b23e14e1128d9002a5482523c52 Mon Sep 17 00:00:00 2001 From: whyour Date: Fri, 7 May 2021 23:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dshell=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/api.sh | 12 ++++++------ shell/update.sh | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/shell/api.sh b/shell/api.sh index 4ee384e5..51ad2d59 100755 --- a/shell/api.sh +++ b/shell/api.sh @@ -31,9 +31,9 @@ add_cron_api() { code=$(echo $api | jq -r .code) message=$(echo $api | jq -r .message) if [[ $code == 200 ]]; then - return "$name 添加成功" + echo -e"$name 添加成功" else - return "$name 添加失败(${message})" + echo -e"$name 添加失败(${message})" fi } @@ -67,9 +67,9 @@ update_cron_api() { code=$(echo $api | jq -r .code) message=$(echo $api | jq -r .message) if [[ $code == 200 ]]; then - return "$name 更新成功" + echo -e"$name 更新成功" else - return "$name 更新失败(${message})" + echo -e"$name 更新失败(${message})" fi } @@ -90,9 +90,9 @@ del_cron_api() { code=$(echo $api | jq -r .code) message=$(echo $api | jq -r .message) if [[ $code == 200 ]]; then - return "$name 删除成功" + echo -e"$name 删除成功" else - return "$name 删除失败(${message})" + echo -e"$name 删除失败(${message})" fi } diff --git a/shell/update.sh b/shell/update.sh index 0052919e..e33c8bf3 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -207,7 +207,8 @@ update_raw() { [[ -z $cron_name ]] && cron_name="$raw_file_name" [[ -z $cron_line ]] && cron_line="0 6 * * *" if [[ -z $cron_id ]]; then - add_cron_api "$cron_line:$cmd_task $filename:$cron_name" + result=$(add_cron_api "$cron_line:$cmd_task $filename:$cron_name") + notify "新增任务通知" "\n$result" # update_cron_api "$cron_line:$cmd_task $filename:$cron_name:$cron_id" fi else