]> Frank Brehm's Git Trees - scripts/root-bin.git/commitdiff
Updated generate-motd.sh
authorFrank Brehm <frank@brehm-online.com>
Sun, 14 Dec 2014 13:59:08 +0000 (14:59 +0100)
committerFrank Brehm <frank@brehm-online.com>
Sun, 14 Dec 2014 13:59:08 +0000 (14:59 +0100)
generate-motd.sh

index 87def8b6e4f62319d517ef589ec42225b7cc2337..c449c0d1ff5df1bd250786fb7dbd3dd4814d0dd3 100755 (executable)
@@ -6,19 +6,24 @@ echo "Generating '${MOTD}' ..."
 export LC_ALL=de_DE.utf8
 
 uname -a >"${MOTD}"
-if [ -f /etc/gentoo-release ] ; then
+if [[ -f /etc/gentoo-release ]] ; then
     cat /etc/gentoo-release >>"${MOTD}"
+elif [[ -x /usr/bin/lsb_release ]] ; then
+    /usr/bin/lsb_release -d | sed -e 's/^[     ]*Description[  ]*:[    ]*//' >> "${MOTD}"
 fi
-if [ -f /etc/motd.tail ] ; then
+if [[ -f /etc/motd.tail ]] ; then
     cat /etc/motd.tail >>"${MOTD}"
 fi
 
-if [ -x /usr/bin/fortune ] ; then
+if [[ -x /usr/bin/fortune ]] ; then
     echo >>"${MOTD}"
     /usr/bin/fortune de >>"${MOTD}"
+elif [[ -x /usr/games/fortune ]] ; then
+    echo >>"${MOTD}"
+    /usr/games/fortune de >>"${MOTD}"
 fi
 
-if [ -x /usr/bin/ddate ] ; then
+if [[ -x /usr/bin/ddate ]] ; then
     echo >>"${MOTD}"
     /usr/bin/ddate >>"${MOTD}"
 fi