Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to fix issue https://github.com/tty228/luci-app-wechatpush/issues/272 #277

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion root/usr/share/wechatpush/wechatpush
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ wait_and_cat() {
local variable_value=$(cat "$file")
eval "${variable_name}='${variable_value}'"
done
rm "$output_dir"/*
if [ ! -f "${dir}/send.lock" ]; then
rm "$output_dir"/*
fi
}

# 初始化设置信息
Expand Down Expand Up @@ -1550,6 +1552,7 @@ function set_ip_black(){
# 发送定时数据
function send(){
echo "`date "+%Y-%m-%d %H:%M:%S"` 【定时数据】创建定时任务" >> ${logfile}
touch "${dir}/send.lock"
disturb;local send_disturb=$?
get_config "send_title" "send_notification"

Expand Down Expand Up @@ -1654,6 +1657,7 @@ function send(){
RETVAL=$?
[ $RETVAL -eq 1 ] && [ "$send_disturb" -eq "0" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】定时推送失败,请检查网络或设置信息" >> ${logfile} || echo "`date "+%Y-%m-%d %H:%M:%S"` ${disturb_text}定时推送任务完成" >> ${logfile}
deltemp
rm -f "${dir}/send.lock"
return $RETVAL
}

Expand Down