unfsck 4->8 indenting change
hostname set via command line not config
This commit is contained in:
parent
e2f5928188
commit
cb6bbd1db1
1 changed files with 119 additions and 121 deletions
14
cli.c
14
cli.c
|
|
@ -2,7 +2,7 @@
|
|||
// vim: sw=8 ts=8
|
||||
|
||||
char const *cvs_name = "$Name: $";
|
||||
char const *cvs_id_cli = "$Id: cli.c,v 1.17 2004/09/21 05:09:09 fred_nerk Exp $";
|
||||
char const *cvs_id_cli = "$Id: cli.c,v 1.18 2004/10/28 03:31:11 bodea Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
|
@ -104,7 +104,7 @@ int cmd_uptime(struct cli_def *cli, char *command, char **argv, int argc);
|
|||
int regular_stuff(struct cli_def *cli);
|
||||
void parsemac(char *string, char mac[6]);
|
||||
|
||||
void init_cli()
|
||||
void init_cli(char *hostname)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[4096];
|
||||
|
|
@ -114,8 +114,8 @@ void init_cli()
|
|||
struct sockaddr_in addr;
|
||||
|
||||
cli = cli_init();
|
||||
if (config->hostname && *config->hostname)
|
||||
cli_set_hostname(cli, config->hostname);
|
||||
if (hostname && *hostname)
|
||||
cli_set_hostname(cli, hostname);
|
||||
else
|
||||
cli_set_hostname(cli, "l2tpns");
|
||||
|
||||
|
|
@ -259,9 +259,6 @@ void cli_do(int sockfd)
|
|||
}
|
||||
}
|
||||
|
||||
if (config->hostname && *config->hostname)
|
||||
cli_set_hostname(cli, config->hostname);
|
||||
|
||||
signal(SIGPIPE, SIG_DFL);
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
signal(SIGHUP, SIG_DFL);
|
||||
|
|
@ -471,6 +468,7 @@ int cmd_show_session(struct cli_def *cli, char *command, char **argv, int argc)
|
|||
"idle",
|
||||
"LAC",
|
||||
"CLI");
|
||||
|
||||
for (i = 1; i < MAXSESSION; i++)
|
||||
{
|
||||
char *userip, *tunnelip;
|
||||
|
|
@ -554,6 +552,7 @@ int cmd_show_tunnels(struct cli_def *cli, char *command, char **argv, int argc)
|
|||
for (x = 0; x < MAXSESSION; x++)
|
||||
if (session[x].tunnel == t && session[x].opened && !session[x].die)
|
||||
sprintf(s, "%s%u ", s, x);
|
||||
|
||||
cli_print(cli, " Sessions: %s", s);
|
||||
}
|
||||
return CLI_OK;
|
||||
|
|
@ -1755,4 +1754,3 @@ void parsemac(char *string, char mac[6])
|
|||
return;
|
||||
memset(mac, 0, 6);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue