squid_servisi 781 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/squid: start/stop squid daemon
  4. #
  5. SSD=/sbin/start-stop-daemon
  6. PROG=/usr/sbin/squid
  7. PID=/var/run/squid.pid
  8. OPTS="-Y"
  9. case $1 in
  10. start)
  11. $SSD --start --pidfile $PID --exec $PROG -- $OPTS
  12. ;;
  13. stop)
  14. $SSD --stop --retry 10 --pidfile $PID --signal INT
  15. ;;
  16. shutdown)
  17. $SSD --stop --retry 60 --pidfile $PID --signal TERM
  18. ;;
  19. restart)
  20. $0 stop
  21. $0 start
  22. ;;
  23. reload)
  24. $SSD --stop --pidfile $PID --signal HUP
  25. ;;
  26. status)
  27. $SSD --status --pidfile $PID
  28. case $? in
  29. 0) echo "$PROG is running with pid $(cat $PID)" ;;
  30. 1) echo "$PROG is not running but the pid file $PID exists" ;;
  31. 3) echo "$PROG is not running" ;;
  32. 4) echo "Unable to determine the program status" ;;
  33. esac
  34. ;;
  35. *)
  36. echo "usage: $0 [start|stop|shutdown|restart|reload|status]"
  37. ;;
  38. esac
  39. # End of file