Skip to content
Snippets Groups Projects
Commit 1344db69 authored by rswindell's avatar rswindell
Browse files

Added the following commands (at Nelgin's request):

(R)ecycle/(S)hutdown/(T)erminate any server (or all servers)
and (!) to execute an external (system) command.
parent aaad4b85
No related branches found
No related tags found
No related merge requests found
......@@ -1736,6 +1736,82 @@ int main(int argc, char** argv)
putnodedat(&scfg,n,&node,file);
printnodedat(&scfg,n,&node);
break;
case 'r': /* recycle */
case 's': /* shutdown */
case 't': /* terminate */
printf("BBS, FTP, Web, Mail, Services, or [All] ? ");
switch(toupper(getch())) {
case 'B':
printf("BBS\n");
if(ch=='t')
bbs_terminate();
else if(ch=='s')
bbs_startup.shutdown_now=TRUE;
else
bbs_startup.recycle_now=TRUE;
break;
case 'F':
printf("FTP\n");
if(ch=='t')
ftp_terminate();
else if(ch=='s')
ftp_startup.shutdown_now=TRUE;
else
ftp_startup.recycle_now=TRUE;
break;
case 'W':
printf("Web\n");
if(ch=='t')
web_terminate();
else if(ch=='s')
web_startup.shutdown_now=TRUE;
else
web_startup.recycle_now=TRUE;
break;
case 'M':
printf("Mail\n");
if(ch=='t')
mail_terminate();
else if(ch=='s')
mail_startup.shutdown_now=TRUE;
else
mail_startup.recycle_now=TRUE;
break;
case 'S':
printf("Services\n");
if(ch=='t')
services_terminate();
else if(ch=='s')
services_startup.shutdown_now=TRUE;
else
services_startup.recycle_now=TRUE;
break;
default:
printf("All\n");
if(ch=='t')
terminate();
else if(ch=='s') {
bbs_startup.shutdown_now=TRUE;
ftp_startup.shutdown_now=TRUE;
web_startup.shutdown_now=TRUE;
mail_startup.shutdown_now=TRUE;
services_startup.shutdown_now=TRUE;
}
else {
bbs_startup.recycle_now=TRUE;
ftp_startup.recycle_now=TRUE;
web_startup.recycle_now=TRUE;
mail_startup.recycle_now=TRUE;
services_startup.recycle_now=TRUE;
}
break;
}
break;
case '!': /* execute */
printf("Command line: ");
fgets(str,sizeof(str),stdin);
system(str);
break;
default:
printf("\nSynchronet Console Version %s%c Help\n\n",VERSION,REVISION);
printf("q = quit\n");
......@@ -1744,6 +1820,10 @@ int main(int argc, char** argv)
printf("l = lock node (toggle)\n");
printf("d = down node (toggle)\n");
printf("i = interrupt node (toggle)\n");
printf("r = recycle servers (when not in use)\n");
printf("s = shutdown servers (when not in use)\n");
printf("t = terminate servers (immediately)\n");
printf("! = execute external command\n");
#if 0 /* to do */
printf("c# = chat with node #\n");
printf("s# = spy on node #\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment