mirror of
https://github.com/bstansell/conserver.git
synced 2025-02-06 02:39:10 +00:00
Merge branch 'client_opt_k'
This commit is contained in:
commit
15359cd1f3
@ -285,6 +285,7 @@ Usage(int wantfull)
|
|||||||
"f(F) force read/write connection (and replay)",
|
"f(F) force read/write connection (and replay)",
|
||||||
"h output this message",
|
"h output this message",
|
||||||
"i(I) display status info in machine-parseable form (on master)",
|
"i(I) display status info in machine-parseable form (on master)",
|
||||||
|
"k abort connection if the console is not 'up'",
|
||||||
"l user use username instead of current username",
|
"l user use username instead of current username",
|
||||||
"M master master server to poll first",
|
"M master master server to poll first",
|
||||||
"n do not read system-wide config file",
|
"n do not read system-wide config file",
|
||||||
@ -312,7 +313,7 @@ Usage(int wantfull)
|
|||||||
%s [generic-args] [-iIuwWx] [console]\n\
|
%s [generic-args] [-iIuwWx] [console]\n\
|
||||||
%s [generic-args] [-hPqQrRV] [-[bB] message] [-d [user][@console]]\n\
|
%s [generic-args] [-hPqQrRV] [-[bB] message] [-d [user][@console]]\n\
|
||||||
[-t [user][@console] message] [-[zZ] cmd]\n\n\
|
[-t [user][@console] message] [-[zZ] cmd]\n\n\
|
||||||
generic-args: [-7DEnUv] [-c cred] [-C config] [-M master]\n\
|
generic-args: [-7DEknUv] [-c cred] [-C config] [-M master]\n\
|
||||||
[-p port] [-l username]\n", progname, progname, progname);
|
[-p port] [-l username]\n", progname, progname, progname);
|
||||||
|
|
||||||
if (wantfull) {
|
if (wantfull) {
|
||||||
@ -1471,8 +1472,13 @@ CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
|||||||
/* try to grok the state of the console */
|
/* try to grok the state of the console */
|
||||||
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
|
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
|
||||||
r = ReadReply(pcf, FLAGFALSE);
|
r = ReadReply(pcf, FLAGFALSE);
|
||||||
if (strncmp(r, "[unknown", 8) != 0 && strncmp(r, "[up]", 4) != 0)
|
if (strncmp(r, "[unknown", 8) != 0 && strncmp(r, "[up]", 4) != 0) {
|
||||||
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
||||||
|
if (config->exitdown == FLAGTRUE) {
|
||||||
|
Error("Console is not 'up'. Exiting. (-k)");
|
||||||
|
Bye(EX_UNAVAILABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* try to grok the version of the server */
|
/* try to grok the version of the server */
|
||||||
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, 0xD6);
|
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, 0xD6);
|
||||||
@ -1905,7 +1911,7 @@ main(int argc, char **argv)
|
|||||||
int fLocal;
|
int fLocal;
|
||||||
static STRING *acPorts = (STRING *)0;
|
static STRING *acPorts = (STRING *)0;
|
||||||
static char acOpts[] =
|
static char acOpts[] =
|
||||||
"7aAb:B:c:C:d:De:EfFhiIl:M:np:PqQrRsSt:uUvVwWxz:Z:";
|
"7aAb:B:c:C:d:De:EfFhikIl:M:np:PqQrRsSt:uUvVwWxz:Z:";
|
||||||
extern int optind;
|
extern int optind;
|
||||||
extern int optopt;
|
extern int optopt;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
@ -2035,6 +2041,10 @@ main(int argc, char **argv)
|
|||||||
pcCmd = "info";
|
pcCmd = "info";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'k':
|
||||||
|
optConf->exitdown = FLAGTRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
if ((optConf->username = StrDup(optarg)) == (char *)0)
|
if ((optConf->username = StrDup(optarg)) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
@ -2232,6 +2242,13 @@ main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
config->striphigh = FLAGFALSE;
|
config->striphigh = FLAGFALSE;
|
||||||
|
|
||||||
|
if (optConf->exitdown != FLAGUNKNOWN)
|
||||||
|
config->exitdown = optConf->exitdown;
|
||||||
|
else if (pConfig->exitdown != FLAGUNKNOWN)
|
||||||
|
config->exitdown = pConfig->exitdown;
|
||||||
|
else
|
||||||
|
config->exitdown = FLAGFALSE;
|
||||||
|
|
||||||
if (optConf->escape != (char *)0)
|
if (optConf->escape != (char *)0)
|
||||||
ParseEsc(optConf->escape);
|
ParseEsc(optConf->escape);
|
||||||
else if (pConfig->escape != (char *)0)
|
else if (pConfig->escape != (char *)0)
|
||||||
|
@ -28,7 +28,7 @@ console \- console server client program
|
|||||||
.IR cmd ]
|
.IR cmd ]
|
||||||
.PP
|
.PP
|
||||||
.IR generic-args :
|
.IR generic-args :
|
||||||
.RB [ \-7DEnUv ]
|
.RB [ \-7DEknUv ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR cred ]
|
.IR cred ]
|
||||||
.RB [ \-C
|
.RB [ \-C
|
||||||
@ -178,6 +178,10 @@ Same as
|
|||||||
.B \-i
|
.B \-i
|
||||||
but just acts on the primary server.
|
but just acts on the primary server.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-k
|
||||||
|
Abort the connection if the console is not in the `up' state immediately
|
||||||
|
upon connecting.
|
||||||
|
.TP
|
||||||
.BI \-l user
|
.BI \-l user
|
||||||
Set the login name used for authentication to
|
Set the login name used for authentication to
|
||||||
.IR user .
|
.IR user .
|
||||||
|
@ -12,6 +12,7 @@ typedef struct config {
|
|||||||
char *port;
|
char *port;
|
||||||
char *escape;
|
char *escape;
|
||||||
FLAG striphigh;
|
FLAG striphigh;
|
||||||
|
FLAG exitdown;
|
||||||
unsigned short replay;
|
unsigned short replay;
|
||||||
unsigned short playback;
|
unsigned short playback;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user