.IP \(bu
Optionally does not display the contents of the \fI/etc/issue\fP file.
.IP \(bu
-Optionally displays an alternative issue file or directory instead of \fI/etc/issue\fP or \fI/etc/issue.d\fP.
+Optionally displays an alternative issue files or directories instead of \fI/etc/issue\fP or \fI/etc/issue.d\fP.
.IP \(bu
Optionally does not ask for a login name.
.IP \(bu
.IP
See \fB\-\-login\-options\fR.
.TP
-\-f, \-\-issue\-file \fIfile|directory\fP
-Display the contents of \fIfile\fP instead of \fI/etc/issue\fP (or other). If the
-specified path is a \fIdirectory\fP then displays all files with .issue file
-extension in version-sort order from the directory. This allows custom
-messages to be displayed on different terminals. The
-\-\-noissue option will override this option.
+\-f, \-\-issue\-file \fIpath\fP
+Specifies a ":" delimited list of files and directories to be displayed instead
+of \fI/etc/issue\fP (or other). All specified files and directories are displayed,
+missing or empty files are silently ignored. If the specified path is a
+directory then display all files with .issue file extension in version-sort
+order from the directory. This allows custom messages to be displayed on
+different terminals. The \fB\-\-noissue\fP option will override this option.
.TP
\-\-show\-issue
Display the current issue file (or other) on the current terminal and exit.
static void parse_args(int argc, char **argv, struct options *op)
{
int c;
+ int opt_show_issue = 0;
enum {
VERSION_OPTION = CHAR_MAX + 1,
list_speeds();
exit(EXIT_SUCCESS);
case ISSUE_SHOW_OPTION:
- show_issue(op);
- exit(EXIT_SUCCESS);
+ opt_show_issue = 1;
break;
case VERSION_OPTION:
output_version();
}
}
+ if (opt_show_issue) {
+ show_issue(op);
+ exit(EXIT_SUCCESS);
+ }
+
debug("after getopt loop\n");
if (argc < optind + 1) {
#endif
if (!(op->flags & F_ISSUE))
goto done;
-
/*
- * The custom issue file or directory specified by: agetty -f <path>.
+ * The custom issue file or directory list specified by:
+ * agetty --isue-file <path[:path]...>
* Note that nothing is printed if the file/dir does not exist.
*/
if (op->issue) {
- struct stat st;
+ char *list = strdup(op->issue);
+ char *file;
- if (stat(op->issue, &st) < 0)
- goto done;
- if (S_ISDIR(st.st_mode))
- issuedir_read(ie, op->issue, op, tp);
- else
- issuefile_read(ie, op->issue, op, tp);
+ if (!list)
+ log_err(_("failed to allocate memory: %m"));
+
+ for (file = strtok(list, ":"); file; file = strtok(NULL, ":")) {
+ struct stat st;
+
+ if (stat(file, &st) < 0)
+ continue;
+ if (S_ISDIR(st.st_mode))
+ issuedir_read(ie, file, op, tp);
+ else
+ issuefile_read(ie, file, op, tp);
+ }
+ free(list);
goto done;
}
-
/* The default /etc/issue and optional /etc/issue.d directory as
* extension to the file. The /etc/issue.d directory is ignored if
* there is no /etc/issue file. The file may be empty or symlink.
fputs(_(" -a, --autologin <user> login the specified user automatically\n"), out);
fputs(_(" -c, --noreset do not reset control mode\n"), out);
fputs(_(" -E, --remote use -r <hostname> for login(1)\n"), out);
- fputs(_(" -f, --issue-file <file> display issue file\n"), out);
+ fputs(_(" -f, --issue-file <list> display issue files or directories\n"), out);
fputs(_(" --show-issue display issue file and exit\n"), out);
fputs(_(" -h, --flow-control enable hardware flow control\n"), out);
fputs(_(" -H, --host <hostname> specify login host\n"), out);