修复shell发送通知

This commit is contained in:
whyour 2022-04-09 11:13:08 +08:00
parent 8818a779b5
commit 54e58c1e08

View File

@ -178,7 +178,7 @@ update_cron() {
notify_api() { notify_api() {
local title=$1 local title=$1
local content=$1 local content=$2
local currentTimeStamp=$(date +%s) local currentTimeStamp=$(date +%s)
local api=$( local api=$(
curl -s --noproxy "*" "http://0.0.0.0:5600/api/system/notify?t=$currentTimeStamp" \ curl -s --noproxy "*" "http://0.0.0.0:5600/api/system/notify?t=$currentTimeStamp" \
@ -196,9 +196,9 @@ notify_api() {
code=$(echo $api | jq -r .code) code=$(echo $api | jq -r .code)
message=$(echo $api | jq -r .message) message=$(echo $api | jq -r .message)
if [[ $code == 200 ]]; then if [[ $code == 200 ]]; then
echo -e "成功" echo -e "通知发送成功"
else else
echo -e "失败(${message})" echo -e "通知失败(${message})"
fi fi
} }