forked from KenT2/pipresents-gapless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pp_control.sh
33 lines (23 loc) · 822 Bytes
/
pp_control.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
#!/bin/sh
# simple example of how to run and exit Pi Presents from a shell script.
# my shell scripting is almost non-existent so beware. The main aim of the script is to
# demonstrate how to start and exit Pi Presents from other applications
# examples:
# ./pp_control.sh run "-p myprofile -b"
# ./pp_control.sh exit
case "$1" in
run)
echo "run"
echo "python /home/pi/pipresents/pipresents.py " "$2"
python /home/pi/pipresents/pipresents.py $2 > /dev/null &
echo $!
;;
exit)
echo "exit"
# aborting Pi Presents Using SIGTERM
# receiving SIGTERM cleans up PP and closes any sub-processes and files used.
# Just print the PID first for debugging
pgrep -f /pipresents/pipresents.py
pkill -f /pipresents/pipresents.py
;;
esac