machine: Disable more output when quiet flag is set (#4196)
This commit is contained in:
parent
86c2fc21f9
commit
fbdec7923f
|
@ -1326,10 +1326,12 @@ static int process_forward(sd_event *event, PTYForward **forward, int master, PT
|
||||||
|
|
||||||
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGWINCH, SIGTERM, SIGINT, -1) >= 0);
|
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGWINCH, SIGTERM, SIGINT, -1) >= 0);
|
||||||
|
|
||||||
if (streq(name, ".host"))
|
if (!arg_quiet) {
|
||||||
log_info("Connected to the local host. Press ^] three times within 1s to exit session.");
|
if (streq(name, ".host"))
|
||||||
else
|
log_info("Connected to the local host. Press ^] three times within 1s to exit session.");
|
||||||
log_info("Connected to machine %s. Press ^] three times within 1s to exit session.", name);
|
else
|
||||||
|
log_info("Connected to machine %s. Press ^] three times within 1s to exit session.", name);
|
||||||
|
}
|
||||||
|
|
||||||
sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
|
sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
|
||||||
sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
|
sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
|
||||||
|
@ -1353,12 +1355,14 @@ static int process_forward(sd_event *event, PTYForward **forward, int master, PT
|
||||||
if (last_char != '\n')
|
if (last_char != '\n')
|
||||||
fputc('\n', stdout);
|
fputc('\n', stdout);
|
||||||
|
|
||||||
if (machine_died)
|
if (!arg_quiet) {
|
||||||
log_info("Machine %s terminated.", name);
|
if (machine_died)
|
||||||
else if (streq(name, ".host"))
|
log_info("Machine %s terminated.", name);
|
||||||
log_info("Connection to the local host terminated.");
|
else if (streq(name, ".host"))
|
||||||
else
|
log_info("Connection to the local host terminated.");
|
||||||
log_info("Connection to machine %s terminated.", name);
|
else
|
||||||
|
log_info("Connection to machine %s terminated.", name);
|
||||||
|
}
|
||||||
|
|
||||||
sd_event_get_exit_code(event, &ret);
|
sd_event_get_exit_code(event, &ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue