Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # ~/.bash_profile
- #
- # Collect useful information about your system
- # $USER is automatically defined
- RB="\e[01;91m"
- GB="\e[01;92m"
- D="\e[49m"
- UT=`cat /proc/uptime | cut -d ' ' -f 1 | cut -d . -f 1`
- PRETTY=`uptime -p`
- if [ "$UT" -ge "43200" ]
- then
- UPTIME="$GB$PRETTY$D"
- else
- UPTIME="$RB$PRETTY$D"
- fi
- cpu=`cat /sys/class/thermal/thermal_zone0/temp`
- if [ "$((cpu/1000))" -gt "0" ] || [ "$((cpu/1000))" -lt "50" ]
- then
- TEMP="\e[92m$((cpu/1000))°C"
- elif [ "$((cpu/1000))" -ge "50" ] || [ "$((cpu/1000))" -lt "60" ]
- then
- TEMP="\e[93m$((cpu/1000))°C"
- elif [ "$((cpu/1000))" -ge "60" ]
- then
- TEMP="\e[91m$((cpu/1000))°C"
- else
- TEMP="Not Available"
- fi
- HOSTNAME=`hostname -a`
- KERNEL=`uname -r`
- CPU=`uname -p`
- ARCH=`uname -m`
- DU=`df --output=pcent / | sed 1d | cut -d '%' -f 1`
- if [ "$DU" -gt "0" ] || [ "$DU" -lt "70" ]
- then
- DISK="\e[92m$DU%"
- elif [ "$DU" -ge "70" ] || [ "$DU" -lt "90" ]
- then
- DISK="\e[93m$DU%"
- elif [ "$DU" -ge "90" ]
- then
- DISK="\e[91m$DU%"
- else
- DISK="Not Available"
- fi
- # The different colours as variables
- W="\033[01;37m"
- B="\033[01;34m"
- R="\033[01;36m"
- G="\033[01;92m"
- X="\033[00;37m"
- echo -e "$B#===============================================================================#"
- echo -e " $W Welcome $G $USER $W to $G $HOSTNAME "
- echo -e " $R ARCH $W= $ARCH "
- echo -e " $R KERNEL $W= $KERNEL "
- echo -e " $R UPTIME $W= $UPTIME "
- echo -e " $R CPU TEMP $W= $TEMP "
- echo -e " $R DISK USAGE $W=$DISK "
- echo -e "$B#===============================================================================#"
- echo -e "$X"
- [[ -f ~/.bashrc ]] && . ~/.bashrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement