kill in stop script

This commit is contained in:
2015-11-15 23:18:09 +01:00
parent 1e984c2b2e
commit c0df1a1aed
3 changed files with 5 additions and 15 deletions
+1 -14
View File
@@ -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');
});