Polipo 668 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. ##
  3. # Polipo
  4. ##
  5. . /etc/rc.common
  6. StartService ()
  7. {
  8. if [ -f /Library/Polipo/bin/polipo ]; then
  9. if pid=$(GetPID polipo); then
  10. return 0
  11. else if [ "${POLIPO:=-NO-}" = "-YES-" ]; then
  12. ConsoleMessage "Starting Polipo"
  13. /Library/Polipo/bin/polipo -c /Library/Polipo/www/config
  14. fi
  15. fi
  16. fi
  17. }
  18. StopService ()
  19. {
  20. if pid=$(GetPID polipo); then
  21. ConsoleMessage "Stopping Polipo"
  22. kill -TERM "${pid}"
  23. else
  24. ConsoleMessage "Polipo not responding."
  25. # Just for sanity (sometimes necessary.)
  26. killall tor 2>/dev/null
  27. fi
  28. }
  29. RestartService ()
  30. {
  31. StopService
  32. StartService
  33. }
  34. RunService "$1"