Commits

Brodie Rao committed fc3e0a5

Initial import

Comments (0)

Files changed (2)

+#!/bin/sh
+
+[ -f /etc/motd.gumby -o ! -t 0 ] || exit 1
+
+PATH="$PATH:/usr/games"
+fortune1=
+fortune2=
+
+for i in `seq 1 3`
+do
+    f=`fortune -s -n 56 | tr '[:lower:]' '[:upper:]'`
+    echo "$f" | grep -q '|' && continue
+    l=`echo "$f" | wc -l`
+    m=`echo "$f" | wc -m`
+    if [ "$l" -le 1 ]
+    then
+        if [ -z "$fortune1" ]
+        then
+            fortune1="$f"
+        elif [ -z "$fortune2" -a "$m" -lt 42 ]
+        then
+            fortune2="$f"
+            break
+        fi
+    fi
+done
+
+if [ -n "$fortune1" ]
+then
+    sed -e "s|HELLO FRIEND\.|$fortune1|" -e "s|HEY!|$fortune2|" /etc/motd.gumby
+else
+    sed -e 's|HEY!||' /etc/motd.gumby
+fi
+             _.-,
+         __.'   |   .,  HELLO FRIEND.
+       ,'_   _  | :` ;
+       |' ` ' `|' : ,'
+       |(.) (.)|  ; ;      ____
+       `|  >  |'  ; ;   .-' _..`.
+     _..| `-' |..'.'   /  .'_.'.'
+   .'.--.     .--'    | .' (.)`. 
+ .'.'   |     |       ;'   ,_   `.   HEY!
+ | :  .-|     |_____.'    ;  `.;-'