]> Frank Brehm's Git Trees - scripts/root-bin.git/commitdiff
Added generate-motd.sh
authorFrank Brehm <frank@brehm-online.com>
Fri, 28 Oct 2011 08:01:55 +0000 (10:01 +0200)
committerFrank Brehm <frank@brehm-online.com>
Fri, 28 Oct 2011 08:01:55 +0000 (10:01 +0200)
generate-motd.sh [new file with mode: 0755]

diff --git a/generate-motd.sh b/generate-motd.sh
new file mode 100755 (executable)
index 0000000..99b37d1
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+MOTD=/etc/motd.1
+
+echo "Generating '${MOTD}' ..."
+export LC_ALL=de_DE.utf8
+
+uname -a >"${MOTD}"
+if [ -f /etc/gentoo-release ] ; then
+    cat /etc/gentoo-release >>"${MOTD}"
+fi
+if [ -f /etc/motd.tail ] ; then
+    cat /etc/motd.tail >>"${MOTD}"
+fi
+
+if [ -x /usr/bin/fortune ] ; then
+    echo >>"${MOTD}"
+    /usr/bin/fortune de >>"${MOTD}"
+fi
+
+if [ -x /usr/bin/ddate ] ; then
+    echo >>"${MOTD}"
+    /usr/bin/ddate >>"${MOTD}"
+fi
+
+echo >>"${MOTD}"
+
+# vim: ts=4 expandtab