1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | #!/bin/bash # check_process() { echo "$ts: checking $1" [ "$1" = "" ] && return 0 [ `pgrep -n pulseaudio` ] && [ `pgrep -n mate-panel` ] && [ `pgrep -n $1` ] && return 1 || return 0 } while [ 1 ]; do # timestamp ts=`date +%T` echo "$ts: begin checking..." check_process "qjackctl" [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `qjackctl >/dev/null` sleep 10 done |