wok diff privoxy/stuff/daemon-privoxy @ rev 7109
Up: inkscape to 0.48.0.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Nov 03 06:33:29 2010 +0000 (2010-11-03) |
parents | |
children | b6858242c35f |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/privoxy/stuff/daemon-privoxy Wed Nov 03 06:33:29 2010 +0000 1.3 @@ -0,0 +1,59 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/daemon-name: Start, stop and restart daemon 1.6 +# on SliTaz, at boot time or with the command line. 1.7 +# 1.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 +. /etc/daemons.conf 1.13 + 1.14 +NAME=Privoxy 1.15 +DESC="Web proxy daemon" 1.16 +DAEMON=/usr/sbin/privoxy 1.17 +OPTIONS="--pidfile /var/run/privoxy.pid" 1.18 +USER="--user privoxy" 1.19 +CONFIG=/etc/privoxy/config 1.20 +PIDFILE=/var/run/privoxy.pid 1.21 + 1.22 +case "$1" in 1.23 + start) 1.24 + if [ -f $PIDFILE ] ; then 1.25 + echo "$NAME already running." 1.26 + exit 1 1.27 + fi 1.28 + echo -n "Starting $DESC: $NAME... " 1.29 + $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null 1.30 + status 1.31 + ;; 1.32 + stop) 1.33 + if [ ! -f $PIDFILE ] ; then 1.34 + echo "$NAME is not running." 1.35 + exit 1 1.36 + fi 1.37 + echo -n "Stopping $DESC: $NAME... " 1.38 + kill `cat $PIDFILE` 1.39 + rm $PIDFILE 1.40 + status 1.41 + ;; 1.42 + restart) 1.43 + if [ ! -f $PIDFILE ] ; then 1.44 + echo "$NAME is not running." 1.45 + exit 1 1.46 + fi 1.47 + kill `cat $PIDFILE` 1.48 + rm $PIDFILE 1.49 + sleep 2 1.50 + echo -n "Restarting $DESC: $NAME... " 1.51 + $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null 1.52 + status 1.53 + ;; 1.54 + *) 1.55 + echo "" 1.56 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.57 + echo "" 1.58 + exit 1 1.59 + ;; 1.60 +esac 1.61 + 1.62 +exit 0