Add option to skip intro in telnet mode.
I am dropping the intro from my instance and also making it not run permanently (sorry, limited bandwidth until I get this on a dedicated cloud instance somewhere).
This commit is contained in:
parent
837cd32902
commit
3c2f770be2
@ -319,6 +319,7 @@ int main(int argc, char ** argv) {
|
|||||||
|
|
||||||
/* Whether or not to show the MOTD intro */
|
/* Whether or not to show the MOTD intro */
|
||||||
char show_intro = 0;
|
char show_intro = 0;
|
||||||
|
char skip_intro = 0;
|
||||||
|
|
||||||
/* Long option names */
|
/* Long option names */
|
||||||
static struct option long_opts[] = {
|
static struct option long_opts[] = {
|
||||||
@ -340,7 +341,7 @@ int main(int argc, char ** argv) {
|
|||||||
|
|
||||||
/* Process arguments */
|
/* Process arguments */
|
||||||
int index, c;
|
int index, c;
|
||||||
while ((c = getopt_long(argc, argv, "eshitnf:r:R:c:C:W:H:", long_opts, &index)) != -1) {
|
while ((c = getopt_long(argc, argv, "eshiItnf:r:R:c:C:W:H:", long_opts, &index)) != -1) {
|
||||||
if (!c) {
|
if (!c) {
|
||||||
if (long_opts[index].flag == 0) {
|
if (long_opts[index].flag == 0) {
|
||||||
c = long_opts[index].val;
|
c = long_opts[index].val;
|
||||||
@ -356,6 +357,9 @@ int main(int argc, char ** argv) {
|
|||||||
case 'i': /* Show introduction */
|
case 'i': /* Show introduction */
|
||||||
show_intro = 1;
|
show_intro = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'I':
|
||||||
|
skip_intro = 1;
|
||||||
|
break;
|
||||||
case 't': /* Expect telnet bits */
|
case 't': /* Expect telnet bits */
|
||||||
telnet = 1;
|
telnet = 1;
|
||||||
break;
|
break;
|
||||||
@ -397,8 +401,8 @@ int main(int argc, char ** argv) {
|
|||||||
if (telnet) {
|
if (telnet) {
|
||||||
/* Telnet mode */
|
/* Telnet mode */
|
||||||
|
|
||||||
/* Intro is implied by telnet mode, so override whatever was asked for. */
|
/* show_intro is implied unless skip_intro was set */
|
||||||
show_intro = 1;
|
show_intro = (skip_intro == 0) ? 1 : 0;
|
||||||
|
|
||||||
/* Set the default options */
|
/* Set the default options */
|
||||||
set_options();
|
set_options();
|
||||||
|
Loading…
Reference in New Issue
Block a user