summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilhelm Schuster <ws@wilhelm.re>2016-09-22 21:49:22 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-22 15:49:22 -0400
commitfbdec7923f3f1762516889341a250f43652d67ba (patch)
tree464d112a28ba7848595a74cf93f886152e514b67
parent86c2fc21f98e5a1a3deb7759f493e24f73e49b85 (diff)
machine: Disable more output when quiet flag is set (#4196)
-rw-r--r--src/machine/machinectl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 74e1a349bc..d2ca2ef342 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -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);
- if (streq(name, ".host"))
- log_info("Connected to the local host. Press ^] three times within 1s to exit session.");
- else
- log_info("Connected to machine %s. Press ^] three times within 1s to exit session.", name);
+ if (!arg_quiet) {
+ if (streq(name, ".host"))
+ log_info("Connected to the local host. Press ^] three times within 1s to exit session.");
+ 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, SIGTERM, NULL, NULL);
@@ -1353,12 +1355,14 @@ static int process_forward(sd_event *event, PTYForward **forward, int master, PT
if (last_char != '\n')
fputc('\n', stdout);
- if (machine_died)
- log_info("Machine %s terminated.", name);
- else if (streq(name, ".host"))
- log_info("Connection to the local host terminated.");
- else
- log_info("Connection to machine %s terminated.", name);
+ if (!arg_quiet) {
+ if (machine_died)
+ log_info("Machine %s terminated.", name);
+ else if (streq(name, ".host"))
+ log_info("Connection to the local host terminated.");
+ else
+ log_info("Connection to machine %s terminated.", name);
+ }
sd_event_get_exit_code(event, &ret);
return ret;