meta-digi-dey: dey-examples: start pulseaudio with 'connectcore-demo' example
The demo now has a "Play music" feature, which requires pulseaudio to be running in the device. This commit checks if pulseaudio is running before starting the demo, and starts the service in the case it is not. Signed-off-by: David Escalona <david.escalona@digi.com>
This commit is contained in:
parent
443b5dbc1d
commit
44a3c1a123
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
readonly DEMOSERVER_BINARY="/srv/www/demoserver.py"
|
readonly DEMOSERVER_BINARY="/srv/www/demoserver.py"
|
||||||
readonly STOP_TIMEOUT="5"
|
readonly STOP_TIMEOUT="5"
|
||||||
|
readonly PULSEAUDIO_START_COMMAND="pulseaudio --start"
|
||||||
|
|
||||||
stop_process() {
|
stop_process() {
|
||||||
# try to stop gracefully
|
# try to stop gracefully
|
||||||
|
|
@ -30,6 +31,7 @@ stop_process() {
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
pkill -0 "pulseaudio" >/dev/null 2>&1 || ${PULSEAUDIO_START_COMMAND}
|
||||||
${DEMOSERVER_BINARY} > /dev/null 2>&1 &
|
${DEMOSERVER_BINARY} > /dev/null 2>&1 &
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue