mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
minor changes
This commit is contained in:
parent
b2f78a4647
commit
31ea86b7a5
2 changed files with 24 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue