diff options
Diffstat (limited to 'daemon.sh')
-rw-r--r-- | daemon.sh | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -8,14 +8,13 @@ get_ident() { is_running() { local pidfile=$1 if [[ -f "$pidfile" ]]; then - cat "$pidfile" | while read pid ident1; do - ident2="$(get_ident "$pid")" - if [[ "$ident1" = "$ident2" ]] && [[ -n "$ident2" ]]; then - return 0 - else - return 1 - fi - done + read -r pid ident1 <"$pidfile" + ident2="$(get_ident "$pid")" + if [[ "$ident1" == "$ident2" ]] && [[ -n "$ident2" ]]; then + return 0 + else + return 1 + fi else return 1; fi |