1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/build/is_running_in_bg.sh

19 lines
219 B
Bash
Raw Normal View History

#!/bin/sh
set -e
running_in_background() {
pid="$1"
case "$("$PS" -o stat= -p "$pid" 2>/dev/null || echo '+')" in
*+*) ;;
*) return 0 ;;
esac
return 1
}
PS="${PS:-ps}"
running_in_background "$@"