wok-next view tinyproxy/stuff/tinyproxy @ rev 12573
poppler-qt4: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 28 20:25:18 2012 +0200 (2012-04-28) |
parents | |
children | 7f188676b59c |
line source
1 #!/bin/sh
2 # /etc/init.d/tinyproxy: Start, stop and restart tinyproxy deamon on SliTaz
4 . /etc/init.d/rc.functions
6 NAME=Tinyproxy
7 DESC="Tiny Proxy"
8 DAEMON=/usr/sbin/tinyproxy
9 OPTION="-c"
10 PIDFILE=/var/run/tinyproxy.pid
12 case "$1" in
13 start)
14 if active_pidfile $PIDFILE tinyproxy ; then
15 echo "$NAME already running."
16 exit 1
17 fi
18 echo -n "Starting $DESC: $NAME... "
19 $DAEMON $OPTION /etc/tinyproxy/tinyproxy.conf
20 status
21 ;;
22 stop)
23 if ! active_pidfile $PIDFILE tinyproxy ; then
24 echo "$NAME is not running."
25 exit 1
26 fi
27 echo -n "Stopping $DESC: $NAME... "
28 killall tinyproxy
29 rm $PIDFILE
30 status
31 ;;
32 restart)
33 if ! active_pidfile $PIDFILE tinyproxy ; then
34 echo "$NAME is not running."
35 exit 1
36 fi
37 echo -n "Restarting $DESC: $NAME... "
38 killall tinyproxy
39 rm $PIDFILE
40 sleep 2
41 $DAEMON $OPTION /etc/tinyproxy/tinyproxy.conf
42 status
43 ;;
44 *)
45 echo ""
46 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
47 echo ""
48 exit 1
49 ;;
50 esac
52 exit 0