From e1076c618ffc3d8d7c5fd74f6ceba81dded20e55 Mon Sep 17 00:00:00 2001 From: ElfQrin Date: Sat, 28 Jan 2017 01:29:34 +0100 Subject: [PATCH] Add files via upload --- _bash_profile | 19 ++++++++++++++----- systatus.sh | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/_bash_profile b/_bash_profile index e4d4813..36f39c2 100644 --- a/_bash_profile +++ b/_bash_profile @@ -1,7 +1,7 @@ # /root/.bash_profile # BASH Shell Start-up -# r2017-01-23 fr2016-10-18 +# r2017-01-28 fr2016-10-18 # by Valerio Capello - http://labs.geody.com/ - License: GPL v3.0 # Get Terminal Window Size @@ -14,8 +14,8 @@ export PS1="\[\e[1;32m\][\$(date +%Y-%m-%d\ %H:%M:%S\ %a)] \u@\h:\w\\\$\[\e[0m\] export HISTTIMEFORMAT="%F %T " # Aliases -alias l="ls -laF --color=auto" -alias d="ls -aF --color=auto" +alias l="ls -laF --group-directories-first --color=auto" +alias d="ls -aF --group-directories-first --color=auto" # Message echo; clear @@ -32,7 +32,15 @@ echo; echo -ne "\033[0;31m"; echo -n "You have ROOT superpowers!"; echo -e "\03 else echo fi -echo "Your Terminal Window Size: $COLUMNS x $LINES" +echo -n "You are "; +if [ -n "${SSH_CONNECTION}" ]; then +echo -n "connected remotely via SSH"; +elif [[ "${DISPLAY%%:0*}" != "" ]]; then +echo -n "connected remotely "; echo -ne "\033[0;31m"; echo -n "NOT"; echo -ne "\033[0m"; echo " via SSH (which is Bad)"; +else +echo -n "connected locally"; +fi +echo ". Your Terminal Window Size: $COLUMNS x $LINES" echo # Software version @@ -45,7 +53,8 @@ mysql -V echo # System status -echo -n "CPU: "; grep "model name" /proc/cpuinfo +echo -n "CPU: "; echo -n "$(grep 'model name' /proc/cpuinfo). "; +echo -n "Cores: "; grep -c 'processor' /proc/cpuinfo grep MemTotal /proc/meminfo df -P -h | nawk '0+$5 >= 90 {print "FS: "$1" ("$6") Size: "$2" Used: "$3" (\033[1;31m"$5"\033[0m) Free: "$4" (\033[1;31m"(100-$5)"%\033[0m)";}' echo; echo -n "Uptime: "; uptime diff --git a/systatus.sh b/systatus.sh index 34aee49..5a66f9f 100644 --- a/systatus.sh +++ b/systatus.sh @@ -1,7 +1,7 @@ #!/bin/bash # BASH Systatus -# r2017-01-23 fr2016-10-18 +# r2017-01-28 fr2016-10-18 # by Valerio Capello - http://labs.geody.com/ - License: GPL v3.0 # Get Terminal Window Size @@ -22,7 +22,15 @@ echo; echo -ne "\033[0;31m"; echo -n "You have ROOT superpowers!"; echo -e "\03 else echo fi -echo "Your Terminal Window Size: $COLUMNS x $LINES" +echo -n "You are "; +if [ -n "${SSH_CONNECTION}" ]; then +echo -n "connected remotely via SSH"; +elif [[ "${DISPLAY%%:0*}" != "" ]]; then +echo -n "connected remotely "; echo -ne "\033[0;31m"; echo -n "NOT"; echo -ne "\033[0m"; echo " via SSH (which is Bad)"; +else +echo -n "connected locally"; +fi +echo ". Your Terminal Window Size: $COLUMNS x $LINES" echo # Software version @@ -35,13 +43,14 @@ mysql -V echo # System status -echo -n "CPU: "; grep "model name" /proc/cpuinfo +echo -n "CPU: "; echo -n "$(grep 'model name' /proc/cpuinfo). "; +echo -n "Cores: "; grep -c 'processor' /proc/cpuinfo echo # grep MemTotal /proc/meminfo # egrep 'Mem|Cache|Swap' /proc/meminfo free -h echo -df -h +df -Th # df -P -h | nawk '0+$5 >= 90 {print "FS: "$1" ("$6") Size: "$2" Used: "$3" (\033[1;31m"$5"\033[0m) Free: "$4" (\033[1;31m"(100-$5)"%\033[0m)";}' echo; echo -n "Uptime: "; uptime echo