diff --git a/yt-dlp-ntfy.sh b/yt-dlp-ntfy.sh index dbbe30a..e10008b 100755 --- a/yt-dlp-ntfy.sh +++ b/yt-dlp-ntfy.sh @@ -5,7 +5,7 @@ set -ueo pipefail PID_FILE="/tmp/yt-dlp-ntfy.pid" # Check if the script is already running -if [ -e "$PID_FILE" ] && kill -0 $(cat "$PID_FILE"); then +if [ -e "$PID_FILE" ] && kill -0 $(cat "$PID_FILE") &>/dev/null; then echo "Script is already running. Exiting." exit 1 fi