#include "utmp-wtmp.h"
#include "special.h"
#include "initreq.h"
+#include "strv.h"
static const char *arg_type = NULL;
static bool arg_all = false;
if (arg_no_wall)
return;
+ if (arg_wall) {
+ char *p;
+
+ if (!(p = strv_join(arg_wall, " "))) {
+ log_error("Failed to join strings.");
+ return;
+ }
+
+ if (*p) {
+ utmp_wall(p);
+ free(p);
+ return;
+ }
+
+ free(p);
+ }
+
if (!table[action])
return;
static int shutdown_help(void) {
- printf("%s [options] [IGNORED] [WALL...]\n\n"
+ printf("%s [options] [now] [WALL...]\n\n"
"Shut down the system.\n\n"
" --help Show this help\n"
" -H --halt Halt the machine\n"
}
}
+ if (argc > optind && !streq(argv[optind], "now"))
+ log_warning("First argument '%s' isn't 'now'. Ignoring.", argv[optind]);
+
/* We ignore the time argument */
if (argc > optind + 1)
arg_wall = argv + optind + 1;