controling mpsyt with bash

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

controling mpsyt with bash

Post by devros »

hello,
I'm trying to use mpsyt https://github.com/mps-youtube/mps-youtube to make simple selector switch to play predefined songs over HDMI. it works really well when i make bash script with this command

Code: Select all

mpsyt "//(name of artist or songs name), 1, all -a shuffle" 

but problem is with implementing stop (or kill) function
tried this simple code to kill process, but it works only in shell not in domoticz..

Code: Select all

#! /bin/bash
sudo /usr/bin/pkill mpsyt  > /dev/null
sudo /usr/bin/pkill mpv  > /dev/null
exit 0
problem is maybe that script in shell is active and i cant send another command, but how fix this, or im missing something ?
it would be really great to create this way some favorite playlist and control them from domoticz

any idea?
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: controling mpsyt with bash

Post by devros »

ok find how to fix it if is somebody interested...
here is fixed first script (process is sent to background)
with this its working so you can have switch that play mpsyt on dummy switch and second script to kill this process.. :)

Code: Select all

#! /bin/bash
mpsyt "//(name of artist or songs name), 1, all -a shuffle" > /dev/null < /dev/null &
exit 0
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest