privoxy.hotplug 518 B

1234567891011121314151617181920
  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