#!/bin/bash
#
# Initfile for Tinyproxy daemon
#
# chkconfig: 345 90 25
# description: A small, efficient HTTP/SSL proxy daemon.
#
# processname: tinyproxy
# config: /etc/tinyproxy/tinyproxy.conf
# pidfile: /var/run/tinyproxy.pid

# Source function library.
source /etc/rc.d/init.d/functions

# Source networking configuration.
source /etc/sysconfig/network

# Check that networking is up.
[ "" = "no" ] && exit 0

[ -f /etc/tinyproxy/tinyproxy.conf ] || exit 0

DAEMON="/usr/bin/tinyproxy"
OPTIONS=
NAME=tinyproxy
DESC=tinyproxy

if [ -r /etc/sysconfig/tinyproxy ]; then
    . /etc/sysconfig/tinyproxy
fi

test -f  || exit 0


case "" in
  start)
    echo -n "Starting : "
    daemon  
    RETVAL=0
    echo
    [  -eq 0 ] && touch /var/lock/subsys/
    ;;
  stop)
    echo -n "Stopping : "
    killproc 
    RETVAL=0
    echo
    [  -eq 0 ] && rm -f /var/lock/subsys/
    ;;
  reload|force-reload)
    echo -n "Reloading  configuration files."
    killproc  -HUP
    echo
    ;;
  status)
    status 
    ;;
  restart)
    echo -n "Restarting : "
    echo
    /dar/tmp/rpm-tmp.65359 stop
    /dar/tmp/rpm-tmp.65359 start
    RETVAL=0
    ;;
  *)
    echo "Usage: /dar/tmp/rpm-tmp.65359 {start|stop|restart|reload|force-reload|status}"
    exit 1
    ;;
esac

exit 
