#!/bin/bash # # tinproxy This shell script takes care of starting and stopping # tinyproxy. # # chkconfig: 2345 90 25 # description: Lightweight, non-caching, optionally anonymizing HTTP proxy # probe: true # pidfile: /var/run/tinyproxy.pid # config: /etc/tinyproxy/tinyproxy.conf ### BEGIN INIT INFO # Provides: tinyproxy # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Short-Description: Lightweight, non-caching, optionally anonymizing HTTP proxy # Description: Lightweight, non-caching, optionally anonymizing HTTP proxy ### END INIT INFO 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) gprintf "Starting %s: " "$DESC" daemon $DAEMON $FLAGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME ;; stop) gprintf "Stopping %s: " "$DESC" killproc $DAEMON RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME ;; reload|force-reload) gprintf "Reloading %s configuration files." "$DESC" killproc $DAEMON -HUP echo ;; status) status $DAEMON ;; restart) gprintf "Restarting %s: " "$DESC" echo $0 stop $0 start RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|restart|reload|force-reload|status}\n" "$0" exit 1 ;; esac exit $RETVAL