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.

58 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_rc.d_functions.in.txt
  5. # Copyright (C) 2006 - 2008 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/rc.d/functions-ansi.in
  18. else
  19. # if not, use plain text
  20. #
  21. banner()
  22. {
  23. echo "$*"
  24. }
  25. title()
  26. {
  27. echo -n "$* ..."
  28. error=0
  29. }
  30. status()
  31. {
  32. if [ ${1:-$error} -eq 0 ]; then
  33. echo " OK"
  34. else
  35. echo " FAIL"
  36. fi
  37. }
  38. fi
  39. # flow functions don't change
  40. #
  41. check()
  42. {
  43. $* || error=$?
  44. }
  45. action()
  46. {
  47. title "$1"
  48. shift
  49. $* || error=$?
  50. status
  51. }