Commit dc5c7de9 authored by Oron Peled's avatar Oron Peled Committed by Tzafrir Cohen

dahdi_cfg: can optionally read config from stdin

Allow for the convention of '-' marking stdin:

  dahdi_cfg -c -
Signed-off-by: 's avatarTzafrir Cohen <tzafrir.cohen@xorcom.com>
parent 1e81ed14
......@@ -1500,7 +1500,10 @@ int main(int argc, char *argv[])
error("Unable to open master device '%s'\n", MASTER_DEVICE);
goto finish;
}
cf = fopen(filename, "r");
if (strcmp(filename, "-") == 0)
cf = fdopen(STDIN_FILENO, "r");
else
cf = fopen(filename, "r");
if (cf) {
while((buf = readline())) {
if (*buf == 10) /* skip new line */
......
......@@ -24,6 +24,8 @@ the DAHDI init script.
.RS
Use an alternative configuration file instead of
.I /etc/dahdi/system.conf
If \fICFG_FILE\fR is '\fB\-\fR', it is read from stdin.
.RE
.B \-C \fICHANNELS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment