* go back to "old" initscript not using procd * privoxy running --no-daemon only logging to STDERR * procd do not support redirection of STDOUT/STDERR, '2>file' as a command parameter does not work Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
18 lines
445 B
Bash
18 lines
445 B
Bash
#!/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
|