spawn to exec
This commit is contained in:
parent
123175287a
commit
7b3591a206
@ -101,10 +101,19 @@ exports.play = function(idx) {
|
|||||||
Log.error(e);
|
Log.error(e);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
var Child = spawn(
|
/*var Child = spawn(
|
||||||
App.get('tools_root')+'action.sh',
|
App.get('tools_root')+'action.sh',
|
||||||
['play']
|
['play']
|
||||||
);
|
);*/
|
||||||
|
|
||||||
|
child = exec(App.get('tools_root')+'action.sh play',
|
||||||
|
function (error, stdout, stderr) {
|
||||||
|
console.log('stdout: ' + stdout);
|
||||||
|
console.log('stderr: ' + stderr);
|
||||||
|
if (error !== null) {
|
||||||
|
console.log('exec error: ' + error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// listen for any response from the child
|
// listen for any response from the child
|
||||||
Child.stdout.on('data', function(chunk) {
|
Child.stdout.on('data', function(chunk) {
|
||||||
|
|||||||
@ -13,6 +13,6 @@ MY_PATH="$(pwd)"
|
|||||||
echo "Action: $1"
|
echo "Action: $1"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
1) echo "play" ;;
|
"play") sh $MY_PATH/bin/start_radio.sh ;;
|
||||||
*) echo "INVALID ACTION!" ;;
|
*) echo "INVALID ACTION!" ;;
|
||||||
esac
|
esac
|
||||||
@ -19,4 +19,4 @@ echo
|
|||||||
echo "${BGre}Start playing $stream2play ...${RCol}"
|
echo "${BGre}Start playing $stream2play ...${RCol}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
#mplayer -slave -quiet $stream2play
|
mplayer -slave -quiet $stream2play
|
||||||
Loading…
x
Reference in New Issue
Block a user