minor changes

This commit is contained in:
coderaiser 2012-10-02 09:47:19 -04:00
parent b2f78a4647
commit 31ea86b7a5
2 changed files with 24 additions and 4 deletions

View file

@ -41,6 +41,25 @@ function onMessage(pConnNum, pSocket){
return function(pCommand) {
console.log(pCommand);
if( pCommand.indexOf('cloudcmd') === 0 ){
pCommand = pCommand.replace('cloudcmd', '');
if(pCommand.indexOf(' exit') === 0){
pCommand = 'kill -9 ' + process.pid;
}
else {
var lMsg = {
stdout : 'cloudcmd exit - for shutdown cloudcmd',
stderr : null
};
lMsg = JSON.stringify(lMsg);
pSocket.send(lMsg);
return;
}
}
/* change code page to unicode */
if(Win32_b)
pCommand = 'chcp 65001 |' + pCommand;