diff options
-rwxr-xr-x | doalogwatch.in | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/doalogwatch.in b/doalogwatch.in index a08b3bd..888c474 100755 --- a/doalogwatch.in +++ b/doalogwatch.in @@ -31,9 +31,7 @@ if [ -z "${services%%--service=-*}" ]; then fi [ -r "${warteAufFile}" ] && \ - ps aux | \ - awk '{print $2" "$(NF)}' | \ - grep -q "^\s*$(cat "${warteAufFile}") \(\S*/\)\?doalogwatch\$" && \ + kill -0 $(cat "${warteAufFile}") 2>/dev/null && \ exit 0 if [ -d "${warteAufFile%/*}" ]; then @@ -52,14 +50,13 @@ while ${warten}; do warten=true # check for currently running backups - ps aux | \ - grep -v "\sgrep\s" | \ - grep -q "\s\(#BINDIR#/\)\?backup\s" && \ + pgrep -x "(#BINDIR#/)?backup" >/dev/null && \ warten=true if [ -r '#ETCDIR#/backup.conf' ]; then for i in 1 2; do for id in "${!backups[@]}"; do - [ -e "#TMPDIR#/${id}.pid" ] && \ + [ -s "#TMPDIR#/${id}.pid" ] && \ + kill -0 $(cat "#TMPDIR#/${id}.pid") 2>/dev/null && \ warten=true done sleep 1 |