swat 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. # Begin /etc/init.d/swat
  3. ### BEGIN INIT INFO
  4. # Provides: swat
  5. # Required-Start: $network
  6. # Should-Start: $remote_fs
  7. # Required-Stop: $network
  8. # Should-Stop: $remote_fs
  9. # Default-Start: 3 4 5
  10. # Default-Stop: 0 1 2 6
  11. # Short-Description: Provides Samba configuration tool
  12. # Description: Starts Samba configuration tool over a secure
  13. # tunnel;
  14. # X-LFS-Provided-By: BLFS
  15. ### END INIT INFO
  16. . /lib/lsb/init-functions
  17. #$LastChangedBy: bdubbs $
  18. #$Date: 2012-04-20 21:17:24 -0500 (Fri, 20 Apr 2012) $
  19. config=/etc/stunnel/swat.conf
  20. if [ ! -r /etc/stunnel/swat.conf ]; then
  21. log_failure_msg "swat configuration file missing: $config"
  22. exit 1
  23. fi
  24. # Pid coordinates with /etc/stunnel/swat.conf
  25. pidfile=/run/stunnel-swat.pid
  26. case "$1" in
  27. start)
  28. log_info_msg "Starting swat..."
  29. start_daemon /usr/bin/stunnel $config
  30. evaluate_retval
  31. ;;
  32. stop)
  33. log_info_msg "Stopping swat..."
  34. killproc -p $pidfile /usr/bin/stunnel
  35. evaluate_retval
  36. ;;
  37. restart)
  38. $0 stop
  39. sleep 1
  40. $0 start
  41. ;;
  42. status)
  43. statusproc -p $pidfile /usr/bin/stunnel
  44. ;;
  45. *)
  46. echo "Usage: $0 {start|stop|restart|status}"
  47. exit 1
  48. ;;
  49. esac
  50. # End /etc/init.d/samba