updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / tinyproxy-git / tinyproxy.sh
blob5580ea804a2ca48030c3140f50f07ee7586308b5
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=$(pidof -o %PPID /usr/sbin/tinyproxy)
8 start() {
9 stat_busy "Starting Tinyproxy"
11 [ -z "$PID" ] && rm -f /var/run/tinyproxy/tinyproxy.pid && \
12 /usr/sbin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf 2>/dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon tinyproxy
18 stat_done
22 stop() {
23 stat_busy "Stopping Tinyproxy"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon tinyproxy
31 stat_done
35 case "$1" in
36 start)
37 start
39 stop)
40 stop
42 restart)
43 $0 stop
44 sleep 1
45 $0 start
48 echo "usage: $0 {start|stop|restart}"
49 esac
50 exit 0