oops, had left in an error causing statement.
[feisty_meow.git] / scripts / core / inventory.sh
1 #!/bin/bash
2
3 # a frivolous but useful script that shows information about the local
4 # computer in terms of an adventure game inventory listing.
5
6 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
7
8 unset codename
9 if [ $OPERATING_SYSTEM == "UNIX" ]; then
10   which lsb_release &>/dev/null
11   if [ $? -eq 0 ]; then
12     codename="$(lsb_release -cs 2>/dev/null)"
13   fi
14 fi
15 if [ -z "$codename" ]; then
16   codename="mysterioso"
17 fi
18
19 # test if this uptime knows the -p flag.
20 uptime -p &>/dev/null
21 if [ $? -eq 0 ]; then
22   up="$(uptime -p)"
23 else
24   up="$(uptime | awk '{print $2 " " $3 " " $4 " plus " $1 " hours" }')"
25 fi
26
27 echo
28 echo "it is $(date +"%A at %H:%M hours on day %e of the %B moon in the gregorian year %Y" | tr A-Z a-z) and our intrepid adventurer $USER is exploring a computer named $(hostname) (code-name $codename) and has found that the machine's OS platform is $(uname -m) and its current incarnation has been ${up}." | splitter 
29 #hmmm: splitter not accepting these args properly right now:
30 #--mincol 2 --maxcol 40
31 echo
32 #echo '++++++++++++++++++++++++++++++++++++++++++'
33 #echo
34 echo "the following things appear to be lying around here..."
35 echo
36 ls -hFC $color_add
37 echo
38 #echo '++++++++++++++++++++++++++++++++++++++++++'
39 #echo
40 echo "there appear to be these entities on this host..."
41 echo
42 who -suT
43 echo
44