OpenSDE Packages Database (without history before r20070)
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.

53 lines
1.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../sysfiles/etc_init.d_functions.in.txt
  5. # Copyright (C) 2006 - 2009 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. if [ -z "$NOCOLOR" ]; then
  15. # assuming this terminal supports ANSI escape sequences
  16. #
  17. . /etc/init.d/functions-ansi.in
  18. else
  19. # if not, use plain text
  20. #
  21. banner() {
  22. echo "$*"
  23. }
  24. title() {
  25. echo -n "$* ..."
  26. error=0
  27. }
  28. status() {
  29. if [ "${1:-$error}" -eq 0 ]; then
  30. echo " OK"
  31. else
  32. echo " FAIL"
  33. fi
  34. }
  35. fi
  36. # flow functions don't change
  37. #
  38. check() {
  39. "$@" || error=$?
  40. }
  41. action() {
  42. title "$1"
  43. shift
  44. "$@" || error=$?
  45. status
  46. }