~重写 set_cron.sh 尝试修复因为定时任务导致系统crontab内容丢失的问题

This commit is contained in:
juewuy
2026-02-02 19:23:03 +08:00
parent 3682a99a79
commit 1bd16b5ca6
5 changed files with 32 additions and 28 deletions

View File

@@ -4,7 +4,7 @@ PIDFILE="/tmp/ShellCrash/$1.pid"
if [ -f "$PIDFILE" ]; then
PID="$(cat "$PIDFILE")"
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
if [ -n "$PID" ] && [ -d "/proc/$PID" ]; then
return 0
fi
fi