kill in stop script
This commit is contained in:
@@ -20,8 +20,6 @@ var Log = null
|
||||
var Helper = null;
|
||||
var Conf = null;
|
||||
|
||||
var Child = null;
|
||||
|
||||
|
||||
exports.init = function(Express, Configuration) {
|
||||
App = Express;
|
||||
@@ -69,19 +67,8 @@ exports.play = function(idx) {
|
||||
var download = wget.download(channel.stream, m3u);
|
||||
download.on('end', function(output) {
|
||||
Log.inspect('Radio: Download completed', output);
|
||||
|
||||
if(Helper.isDefinedAndNotNull(Child)) {
|
||||
// kill active instances
|
||||
try {
|
||||
Child.kill();
|
||||
} catch(err) {
|
||||
Log.error('Radio: Error killing process');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Child.stdin.pause();
|
||||
Child.kill();
|
||||
Helper.shspawn(App.get('tools_root')+'action.sh stop');
|
||||
Helper.shspawn(App.get('tools_root')+'action.sh play');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user