3 # a frivolous but useful script that shows information about the local
4 # computer in terms of an adventure game inventory listing.
6 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8 unset -v codename osname osver
9 if [ $OPERATING_SYSTEM == "UNIX" ]; then
10 if [ -z "$IS_DARWIN" ]; then
11 # we only try running lsb_release if not on a mac.
12 which lsb_release &>/dev/null
14 codename="$(lsb_release -cs 2>/dev/null)"
15 osname="$(lsb_release -is 2>/dev/null)"
16 osver="$(lsb_release -rs 2>/dev/null)"
19 # darwin / mac doesn't have lsb since not linux.
20 #Usage: sw_vers [-productName|-productVersion|-buildVersion]
21 osname="$(sw_vers -productName 2>/dev/null)"
22 osver="$(sw_vers -productVersion 2>/dev/null)"
23 #echo "osname = '$osname' and osver = '$osver'"
24 if [[ "$osver" =~ ^10\.15.*$ ]]; then
26 elif [[ "$osver" =~ ^10\.14.*$ ]]; then
28 elif [[ "$osver" =~ ^10\.13.*$ ]]; then
29 codename="High Sierra"
30 elif [[ "$osver" =~ ^11\..*$ ]]; then
32 elif [[ "$osver" =~ ^12\..*$ ]]; then
35 codename="$(sw_vers -buildVersion 2>/dev/null)"
39 if [ -z "$codename" ]; then
45 # see if uptime even exists.
48 # test if this uptime knows the -p flag.
53 up="$(uptime | awk '{print $2 " " $3 " " $4 " plus " $1 " hours" }')"
56 # if we can't do this, then we're not even on windows cygwin. wth are we?
57 up="up a whole $(cat /proc/uptime|awk '{print $1}') seconds, yo"
60 # decide whether they've got splitter available or not.
61 if [ -f "$FEISTY_MEOW_BINARIES/splitter" -o -f "$FEISTY_MEOW_BINARIES/splitter.exe" ]; then
62 # calculate the number of columsn in the terminal.
64 splitter="$FEISTY_MEOW_BINARIES/splitter --maxcol $(($cols - 1))"
66 # not available, so just emit as huge overly long string.
70 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) that is running in a thoughtspace called $osname $osver (code-name $codename), and $USER has deduced that the machine's OS platform is $(uname -m) and its current incarnation has been ${up}." | $splitter
72 echo "the following things appear to be lying around here..."
76 echo "there appear to be these entities on this host..."