Merge pull request #247 from zzzzzhy/patch-2

定时任务判断fix
This commit is contained in:
kuaifan 2025-01-17 20:24:22 +08:00 committed by GitHub
commit 5c564524a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
cmd
View File

@ -328,7 +328,7 @@ https_auto() {
fi
new_job="* 6 * * * docker run -it --rm -v $(pwd):/work nginx:alpine sh /work/bin/https renew"
current_crontab=$(crontab -l 2>/dev/null)
if echo "$current_crontab" | grep -v "https renew"; then
if ! echo "$current_crontab" | grep -v "https renew"; then
echo "任务已存在,无需添加。"
else
crontab -l |{