3proxy.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: 3proxy
  4. # Required-Start:
  5. # Required-Stop:
  6. # Should-Start:
  7. # Should-Stop:
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Start/stop 3proxy
  11. # Description: Start/stop 3proxy, tiny proxy server
  12. ### END INIT INFO
  13. # chkconfig: 2345 20 80
  14. # description: 3proxy tiny proxy server
  15. case "$1" in
  16. start)
  17. echo Starting 3Proxy
  18. /bin/3proxy /etc/3proxy/3proxy.cfg
  19. RETVAL=$?
  20. echo
  21. [ $RETVAL ]
  22. ;;
  23. stop)
  24. echo Stopping 3Proxy
  25. if [ -f /var/run/3proxy/3proxy.pid ]; then
  26. /bin/kill `cat /var/run/3proxy/3proxy.pid`
  27. else
  28. /usr/bin/killall 3proxy
  29. fi
  30. RETVAL=$?
  31. echo
  32. [ $RETVAL ]
  33. ;;
  34. restart|reload)
  35. echo Reloading 3Proxy
  36. if [ -f /var/run/3proxy/3proxy.pid ]; then
  37. /bin/kill -s USR1 `cat /var/run/3proxy/3proxy.pid`
  38. else
  39. /usr/bin/killall -s USR1 3proxy
  40. fi
  41. ;;
  42. *)
  43. echo Usage: $0 "{start|stop|restart}"
  44. exit 1
  45. esac
  46. exit 0