Skip to content

Commit

Permalink
Merge pull request #3 from clouddrove/CD-85
Browse files Browse the repository at this point in the history
change banner
  • Loading branch information
anmolnagpal committed Nov 30, 2019
2 parents 03b9149 + ecc160e commit f8fd1c1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions templates/config/extra.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
# {{ ansible_managed }}

printf "\n"
TEXT="{{Env | default ('')}} {{hostvars[inventory_hostname].EcType | default ('')}} {{hostvars[inventory_hostname].Nr | default ('')}}"
sysbanner=`perl -e "print uc('$TEXT');"`
figlet $sysbanner
printf "\n"

upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
secs=$((${upSeconds}%60))
mins=$((${upSeconds}/60%60))
hours=$((${upSeconds}/3600%24))
days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`

# get the load averages
read one five fifteen rest < /proc/loadavg

echo "$(tput setaf 033)
___ _ ___ _ _ ___ $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) HostName...........:$(tput setaf 244) $(tput bold)`perl -e "print uc('$TEXT');"`$(tput sgr0)$(tput setaf 033)
/ __|| | / _ \ | | | || \ $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) OS.................:$(tput setaf 244) `uname -srmo`$(tput setaf 033)
| (__ | |__ | (_) || |_| || |) | $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) Uptime.............:$(tput setaf 244) ${UPTIME}$(tput setaf 033)
\___||____| \___/ \___/ |___/ $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) Memory.............:$(tput setaf 244) `cat /proc/meminfo | grep MemFree | awk {'print $2/1000000'}`G (Free) / `cat /proc/meminfo | grep MemTotal | awk {'print $2/1000000'}`G (Total)
___ ___ ___ __ __ ___ $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) HDD................:$(tput setaf 244) `df -h --total | grep total | awk '{print $4}'` (Free) / `df -h --total | grep total | awk '{print $2}'` (Total)
| \ | _ \ / _ \ \ \ / /| __| $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) Load Averages......:$(tput setaf 244) ${one}, ${five}, ${fifteen} (1, 5, 15 min)
| |) || /| (_) | \ V / | _| $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) Running Processes..:$(tput setaf 244) `ps ax | wc -l | tr -d " "`
|___/ |_|_\ \___/ \_/ |___| $(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) Internal IP........:$(tput setaf 244) `ip a | grep glo | awk '{print $2}' | head -1 | cut -f1 -d/`
$(tput setaf 033)|$(tput setaf 244)| $(tput setaf 033) External IP........:$(tput setaf 244) `wget -q -O - http://icanhazip.com/ | tail`

$(tput sgr0)"

# UTF-8 Compass generation
export LC_ALL='en_US.UTF-8'
Expand Down

0 comments on commit f8fd1c1

Please sign in to comment.