From 2e8db8a8fad52c97a67523ac76823bb0f2cbd4ee Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 12 Apr 2015 17:47:55 -0400 Subject: [PATCH] nice change to add in the os name and version. --- scripts/core/inventory.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/core/inventory.sh b/scripts/core/inventory.sh index 4248c2a2..8127d598 100644 --- a/scripts/core/inventory.sh +++ b/scripts/core/inventory.sh @@ -5,15 +5,19 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" -unset codename +unset -v codename osname osver if [ $OPERATING_SYSTEM == "UNIX" ]; then which lsb_release &>/dev/null if [ $? -eq 0 ]; then codename="$(lsb_release -cs 2>/dev/null)" + osname="$(lsb_release -is 2>/dev/null)" + osver="$(lsb_release -rs 2>/dev/null)" fi fi if [ -z "$codename" ]; then codename="mysterioso" + osname="unspecified" + osver="0.0?" fi # test if this uptime knows the -p flag. @@ -25,7 +29,7 @@ else fi echo -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 +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 running $osname $osver 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 #hmmm: splitter not accepting these args properly right now: #--mincol 2 --maxcol 40 echo -- 2.34.1