Ubuntu Pastebin

Paste from schaap137 at Sun, 23 Aug 2015 12:46:51 +0000

Download as text
 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
Download as text