provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
494 B

#!/bin/bash
hostname=$(hostname -s)
number=$(echo $hostname | grep -oP '[0-9]*$')
hostname=${hostname%"$number"}
rows=9
case $hostname in
'prod')
#print in RED
echo -ne "\033[31;1m"
;;
'beta')
rows=7
#print in ORANGE
echo -ne "\033[33;1m"
;;
'dev')
rows=7
#print in GREEN
echo -ne "\033[33;1m"
;;
*)
#print in GREEN
echo -ne "\033[32;1m"
;;
esac
fullname="$hostname $number"
figlet -f big "$fullname" | head -n$rows
echo -ne "\033[0m"