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

7 months ago
  1. #!/bin/bash
  2. hostname=$(hostname -s)
  3. number=$(echo $hostname | grep -oP '[0-9]*$')
  4. hostname=${hostname%"$number"}
  5. rows=9
  6. case $hostname in
  7. 'prod')
  8. #print in RED
  9. echo -ne "\033[31;1m"
  10. ;;
  11. 'beta')
  12. rows=7
  13. #print in ORANGE
  14. echo -ne "\033[33;1m"
  15. ;;
  16. 'dev')
  17. rows=7
  18. #print in GREEN
  19. echo -ne "\033[33;1m"
  20. ;;
  21. *)
  22. #print in GREEN
  23. echo -ne "\033[32;1m"
  24. ;;
  25. esac
  26. fullname="$hostname $number"
  27. figlet -f big "$fullname" | head -n$rows
  28. echo -ne "\033[0m"