diff options
-rw-r--r-- | etc/motd | 4 | ||||
-rw-r--r-- | usr.bin/osh/osh.c | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/etc/motd b/etc/motd new file mode 100644 index 0000000..62718f4 --- /dev/null +++ b/etc/motd @@ -0,0 +1,4 @@ +::::::::::::::::::::::::::::::::::::::: +:: OSMORA GATEWAY ~ Every key echos :: +:: ..... Proceed with purpose ..... :: +::::::::::::::::::::::::::::::::::::::: diff --git a/usr.bin/osh/osh.c b/usr.bin/osh/osh.c index af7f4ab..3b41747 100644 --- a/usr.bin/osh/osh.c +++ b/usr.bin/osh/osh.c @@ -426,6 +426,25 @@ open_script(const char *pathname) return 0; } +static void +dump_file(const char *pathname) +{ + FILE *file; + char buf[64]; + int fd; + + file = fopen(pathname, "r"); + if (file == NULL) { + return; + } + + while (fgets(buf, sizeof(buf), file) != NULL) { + printf("%s", buf); + } + + fclose(file); +} + int main(int argc, char **argv) { @@ -442,7 +461,7 @@ main(int argc, char **argv) running = 1; bell_fd = open("/dev/beep", O_WRONLY); - puts(WELCOME); + dump_file("/etc/motd"); while (running) { printf(PROMPT, getlogin()); |