Ei kuvausta

privoxy.hotplug 445B

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