removed redundant functions from quickinfo+
adde more disk type detection
This commit is contained in:
parent
4430da088f
commit
904c24ea2a
1 changed files with 6 additions and 17 deletions
|
|
@ -9,15 +9,8 @@
|
||||||
# Written by Alan "pyr0ball" Weinstock #
|
# Written by Alan "pyr0ball" Weinstock #
|
||||||
###############################################################
|
###############################################################
|
||||||
|
|
||||||
scriptname=${0##*/}
|
|
||||||
rundir=$(cd `dirname $0` && pwd)
|
|
||||||
source $prbl_functions
|
source $prbl_functions
|
||||||
|
|
||||||
# Set to only run on interactive sessions (Disabled as cache
|
|
||||||
# generation is non-interactive, so this would cause outdated
|
|
||||||
# information to be displayed)
|
|
||||||
#[[ "$-" == *i* ]] || exit 0
|
|
||||||
|
|
||||||
# Cache File Parameters
|
# Cache File Parameters
|
||||||
cachefile=quickinfo.cache
|
cachefile=quickinfo.cache
|
||||||
cachefile_location=$HOME/.quickinfo
|
cachefile_location=$HOME/.quickinfo
|
||||||
|
|
@ -26,15 +19,6 @@ if [ ! -d $cachefile_location ] ; then
|
||||||
fi
|
fi
|
||||||
cache=$(echo "${cachefile_location}/${cachefile}")
|
cache=$(echo "${cachefile_location}/${cachefile}")
|
||||||
|
|
||||||
### Functions table
|
|
||||||
|
|
||||||
################################
|
|
||||||
|
|
||||||
warn(){
|
|
||||||
ec=$?
|
|
||||||
[ "${ec}" == "0" ] && ec=1
|
|
||||||
echo "WARNING[code=$ec}: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
|
||||||
|
|
@ -131,6 +115,11 @@ while getopts ":cdh" opt
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
|
||||||
|
# Set to only run on interactive sessions (Disabled as cache
|
||||||
|
# generation is non-interactive, so this would cause outdated
|
||||||
|
# information to be displayed)
|
||||||
|
#[[ "$-" == *i* ]] || fail "non-interactive session"
|
||||||
|
|
||||||
# Checks if cachefile exists yet, and if not, warns the user
|
# Checks if cachefile exists yet, and if not, warns the user
|
||||||
if [ ! -f $cache ] ; then
|
if [ ! -f $cache ] ; then
|
||||||
cachemissing=$(echo "Quickinfo cache file is inaccessible. some information may be missing")
|
cachemissing=$(echo "Quickinfo cache file is inaccessible. some information may be missing")
|
||||||
|
|
@ -287,7 +276,7 @@ boxline " System Load: ${load_averages}"
|
||||||
boxline " CPU Temp: ${lbl}${cputemp}${dfl} | Utilization: ${lrd}${cpu_util}%${dfl}"
|
boxline " CPU Temp: ${lbl}${cputemp}${dfl} | Utilization: ${lrd}${cpu_util}%${dfl}"
|
||||||
boxline " Memory used/total: ${mem_usage}"
|
boxline " Memory used/total: ${mem_usage}"
|
||||||
boxline " Disk Usage:"
|
boxline " Disk Usage:"
|
||||||
for i in $(/bin/df -h | grep "sd\|md\|mapper\|nvme" | awk '{print $1}') ; do
|
for i in $(/bin/df -h | grep "sd\|md\|mapper\|nvme\|mmcblk\|root" | awk '{print $1}') ; do
|
||||||
boxline " `/bin/df -h | grep $i | awk '{print $5}'` $i: `/bin/df -h | grep $i | awk '{print $6}'`"
|
boxline " `/bin/df -h | grep $i | awk '{print $5}'` $i: `/bin/df -h | grep $i | awk '{print $6}'`"
|
||||||
done
|
done
|
||||||
boxline ""
|
boxline ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue