second commit

This commit is contained in:
pvincent
2024-02-21 23:32:34 +04:00
parent 9a4551ca3a
commit 7cdc45397d
82 changed files with 7172 additions and 6 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/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"