File: client_connection_test.sh

package info (click to toggle)
jacktrip 1.3.0%2Bds0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,744 kB
  • sloc: cpp: 15,253; sh: 355; makefile: 113
file content (44 lines) | stat: -rwxr-xr-x 999 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#tests the jacktrip client connection to a hub server

#kills existing jackd process, assuming current user has perms
if pgrep -x "jackd"; then
  echo 'stopping jackd'
  command killall jackd
  sleep 5
fi

#kills existing jacktrip processes, assuming current user has perms
if pgrep -x "jacktrip"; then
  echo 'stopping jacktrip'
  command killall jacktrip
  sleep 15
fi

#start jackd
gnome-terminal -- command jackd -dalsa -dhw:0 -r48000 -p1024 -n2 > /dev/null 2>&1
#command jacktrip -C 171.64.197.165 >> output.txt 2>&1 &
sleep 5
command jacktrip -C 171.64.197.165 > output.txt 2>&1 &
sleep 5
outputmsg=`cat output.txt`
echo "$outputmsg"

regExp='.*received connection.*'

if [[ "${outputmsg,,}" =~ $regExp ]]; then
  echo "Connection test passed!"
else
  echo "Connection test failed!"
fi

sleep 5
if pgrep -x "jackd"; then
  echo "killing jackd to clean up"
  command killall jackd
fi

if pgrep -x "jacktrip"; then
  echo "killing jacktrip to clean up"
  command killall jacktrip
fi