/
np-doctor.sh
executable file
·40 lines (33 loc) · 1.01 KB
/
np-doctor.sh
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
#!/usr/bin/env bash
set -e
source "${BASH_SOURCE%/*}/shared/functions.sh"
source "${BASH_SOURCE%/*}/shared/functionality.sh"
source "${BASH_SOURCE%/*}/shared/mutexed.sh"
echo "Configuration: $configConfigFolder"
echo "External player: '$externalPlayerExec'"
echo "fswatch: '$fswatchExec'"
echo "Shuffler: '$externalShuffleExec'"
echo "Line reverser: '$reverseLineOrderExec'"
echo -n "Daemon: "
if isValidPidFile "$configDaemonPidFile" && isPidRunningFromFile "$configDaemonPidFile";
then
echo "running (pid $(cat "$configDaemonPidFile" ))"
else
echo "stopped"
fi
echo -n "Player: "
if isValidPidFile "$configPlayerPidFile" && isPidRunningFromFile "$configPlayerPidFile";
then
echo "playing (pid $(cat "$configPlayerPidFile" ))"
else
echo "stopped"
fi
echo -n "External player: "
if isValidPidFile "$configExternalPlayerPidFile" && isPidRunningFromFile "$configExternalPlayerPidFile";
then
echo "playing (pid $(cat "$configExternalPlayerPidFile" ))"
echo -n "Sound: "
highlight "$(getNextSound)"
else
echo "stopped"
fi