functions.sh 605 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # (c) 2014-2015 Freifunk Paderborn <maschinenraum@paderborn.freifunk.net>
  3. #
  4. # Helper functions for 'fancy' output
  5. function progress {
  6. echo -en "\033[1;34m➔ "
  7. echo -en $*
  8. echo -en "\033[0m\n"
  9. }
  10. function debug {
  11. [ "_$VERBOSE" == "_1" ] || return
  12. echo -en "\033[1;37m # "
  13. echo -en $*
  14. echo -en "\033[0m\n"
  15. }
  16. function info {
  17. echo -en "\033[1;36m"
  18. echo -en $*
  19. echo -en "\033[0m\n"
  20. }
  21. function success {
  22. echo -en "\033[1;32m ✔ "
  23. echo -en $*
  24. echo -en "\033[0m\n"
  25. }
  26. function abort {
  27. echo -en "\033[1;31m ✘ "
  28. echo -en $*
  29. echo -en "\033[0m\n"
  30. popd > /dev/null
  31. exit 99
  32. }