You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
518 B

  1. #!/bin/sh
  2. # only (re-)start on ifup
  3. [ "$ACTION" = "ifup" ] || exit 0
  4. # only start if boot_delay is done
  5. [ -f /tmp/privoxy.hotplug ] || exit 0
  6. PIDFILE=/var/run/privoxy.pid
  7. _PID=$(cat $PIDFILE 2>/dev/null)
  8. kill -1 $_PID 2>/dev/null
  9. if [ $? -eq 0 ]; then
  10. # only restart if already running
  11. logger -p daemon.info -t "privoxy[$_PID]" \
  12. "Restart request due to '$ACTION' of interface '$INTERFACE'"
  13. /etc/init.d/privoxy restart
  14. else
  15. # only start if enabled
  16. /etc/init.d/privoxy enabled && /etc/init.d/privoxy start
  17. fi