From: Chris Koeritz Date: Sun, 12 Apr 2015 21:47:55 +0000 (-0400) Subject: nice change to add in the os name and version. X-Git-Tag: 2.140.90~654 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=2e8db8a8fad52c97a67523ac76823bb0f2cbd4ee;p=feisty_meow.git nice change to add in the os name and version. --- 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