Skip to content

Commit

Permalink
Avoid non-portable 'pgrep -c' by piping to wc. Issue graysky2#344
Browse files Browse the repository at this point in the history
  • Loading branch information
morgant committed Jan 1, 2023
1 parent ba237f7 commit f162bc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/profile-sync-daemon.in
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ do_unsync() {
parse() {
psd_state=$(systemctl --user is-active psd)
resync_state=$(systemctl --user is-active psd-resync.timer)
psd_suspend_sync_state=$(pgrep -cf "psd-suspend-sync")
psd_suspend_sync_state=$(pgrep -f "psd-suspend-sync" | wc -l | tr -d ' ')
if [[ "$psd_suspend_sync_state" != 0 ]]; then
psss_state="enabled"
else
Expand Down Expand Up @@ -756,7 +756,7 @@ take_inhibit_lock() {
}

release_inhibit_lock() {
[[ "$(pgrep -cf "psd-suspend-sync")" != 0 ]] && pkill -f psd-suspend-sync
[[ "$(pgrep -f "psd-suspend-sync" | wc -l | tr -d ' ')" != 0 ]] && pkill -f psd-suspend-sync
}

case "$1" in
Expand Down

0 comments on commit f162bc7

Please sign in to comment.