aboutsummaryrefslogtreecommitdiff
path: root/net/privoxy/files/privoxy.hotplug
blob: bd668017f06d40a401cb6cbbc261133dc0f9a330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# only (re-)start on ifup
[ "$ACTION" = "ifup" ] || exit 0

PIDFILE=/var/run/privoxy.pid

_PID=$(cat $PIDFILE 2>/dev/null)
kill -1 $_PID 2>/dev/null
if [ $? -eq 0 ]; then
	# only restart if already running
	logger -p daemon.info -t "privoxy[$_PID]" \
		"Restart request due to '$ACTION' of interface '$INTERFACE'"
	/etc/init.d/privoxy restart
else
	# only start if enabled
	/etc/init.d/privoxy enabled && /etc/init.d/privoxy start
fi