mplayer call to shell script

This commit is contained in:
Gerrit Linnemann 2015-11-09 10:33:52 +01:00
parent e167c8f6dd
commit 7e4839bbe5
4 changed files with 36 additions and 7 deletions

View File

@ -27,7 +27,7 @@ app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.set('tools_root', __dirname + '/');
app.set('tools_root', __dirname + '/bin/');
Log.init(app);

View File

@ -102,12 +102,8 @@ exports.play = function(idx) {
}*/
var Child = spawn(
'mplayer',
[
'-slave',
'-quiet',
stream2play
]
App.get('tools_root')+'start_radio.sh',
[]
);
// listen for any response from the child

View File

@ -0,0 +1,15 @@
#!/bin/sh
# V0.1
RCol='\033[0m' # Text Reset
# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds
Bla='\033[0;30m'; BBla='\033[1;30m'; UBla='\033[4;30m'; IBla='\033[0;90m'; BIBla='\033[1;90m'; On_Bla='\033[40m'; On_IBla='\033[0;100m';
Red='\033[0;31m'; BRed='\033[1;31m'; URed='\033[4;31m'; IRed='\033[0;91m'; BIRed='\033[1;91m'; On_Red='\033[41m'; On_IRed='\033[0;101m';
Gre='\033[0;32m'; BGre='\033[1;32m'; UGre='\033[4;32m'; IGre='\033[0;92m'; BIGre='\033[1;92m'; On_Gre='\033[42m'; On_IGre='\033[0;102m';
Yel='\033[0;33m'; BYel='\033[1;33m'; UYel='\033[4;33m'; IYel='\033[0;93m'; BIYel='\033[1;93m'; On_Yel='\033[43m'; On_IYel='\033[0;103m';
Blu='\033[0;34m'; BBlu='\033[1;34m'; UBlu='\033[4;34m'; IBlu='\033[0;94m'; BIBlu='\033[1;94m'; On_Blu='\033[44m'; On_IBlu='\033[0;104m';
Pur='\033[0;35m'; BPur='\033[1;35m'; UPur='\033[4;35m'; IPur='\033[0;95m'; BIPur='\033[1;95m'; On_Pur='\033[45m'; On_IPur='\033[0;105m';
Cya='\033[0;36m'; BCya='\033[1;36m'; UCya='\033[4;36m'; ICya='\033[0;96m'; BICya='\033[1;96m'; On_Cya='\033[46m'; On_ICya='\033[0;106m';
Whi='\033[0;37m'; BWhi='\033[1;37m'; UWhi='\033[4;37m'; IWhi='\033[0;97m';

18
kitchenradio/bin/start_radio.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# V0.1
### DEFINITIONS
MY_PATH="$(pwd)"
. $MY_PATH/_inc/def_text_coloring.sh
stream2play=`cat config.txt`
### PRORGAM
echo
echo "${BGre}Start playing ...${RCol}"
echo
mplayer -slave -quiet $stream2play