Fixed check for already running

This commit is contained in:
Ich bin Frei 2020-12-13 06:57:14 +02:00
parent a57f02f6a6
commit 1530d76019

View File

@ -2,8 +2,8 @@
# Refresh clock at exactly 00 seconds
refresh(){
SCRIPT_NAME=`basename "$0"`
pidof -x $SCRIPT_NAME && exit 1 # exit if already running
PID=$(pidof -x `basename "$0"`)
[ "$PID" = "$BASHPID" ] || exit 1 # exit if already running
sleep $((60-$(date "+%S")))
kill -35 $(pidof dwmblocks)
}