#!/bin/bash # # tinproxy This shell script takes care of starting and stopping # tinyproxy. # # chkconfig: 345 90 25 # description: TinyProxy - A lightweight, non-caching, optionally \ # anonymizing http proxy # probe: true # pidfile: /var/run/tinyproxy.pid # config: /etc/tinyproxy/tinyproxy.conf PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /etc/tinyproxy/tinyproxy.conf ] || exit 0 DAEMON=/usr/sbin/tinyproxy FLAGS= NAME=tinyproxy DESC=tinyproxy if [ -r /etc/sysconfig/tinyproxy ]; then . /etc/sysconfig/tinyproxy fi test -f $DAEMON || exit 0 case "$1" in start) echo -n "Starting $DESC: " daemon $DAEMON $FLAGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME ;; stop) echo -n "Stopping $DESC: " killproc $DAEMON RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME ;; reload|force-reload) echo -n "Reloading $DESC configuration files." killproc $DAEMON -HUP echo ;; status) status $DAEMON ;; restart) echo -n "Restarting $DESC: " echo $0 stop $0 start RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" exit 1 ;; esac exit $RETVAL