rc.postfix 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. # Copyright 2006, Alan Hicks, Lizella, GA
  3. # All rights reserved.
  4. #
  5. # Redistribution and use of this script, with or without modification, is
  6. # permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  14. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  17. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  18. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  19. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  20. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. #
  22. postfix_start()
  23. {
  24. /usr/sbin/postfix start
  25. }
  26. postfix_stop()
  27. {
  28. /usr/sbin/postfix stop
  29. }
  30. postfix_restart()
  31. {
  32. postfix_stop
  33. postfix_start
  34. }
  35. postfix_reload()
  36. {
  37. /usr/sbin/postfix reload
  38. }
  39. postfix_status()
  40. {
  41. /usr/sbin/postfix status
  42. }
  43. case $1 in
  44. 'start')
  45. postfix_start
  46. ;;
  47. 'stop')
  48. postfix_stop
  49. ;;
  50. 'restart')
  51. postfix_restart
  52. ;;
  53. 'reload')
  54. postfix_reload
  55. ;;
  56. 'status')
  57. postfix_status
  58. ;;
  59. *)
  60. echo "usage $0 start|stop|restart|reload|status"
  61. esac