source: freewrt/package/tinyproxy/files/tinyproxy.init@ 583d755

freewrt_1_0 freewrt_2_0
Last change on this file since 583d755 was 583d755, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • change the SYSV init system to add a target "autostart"
  • on system startup, call autostart instead of start
  • on autostart, check /etc/rc.conf for whether the service is enabled and act appropriately; fall through into start target
  • move some pre-startup checks into the start target
  • some whitespace cleanup, when it makes much sense (XXX when I get the person who wrote these scripts...)
  • optimise dropbear a little

ok and approved wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@191 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#! /bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4NAME=tinyproxy
5DESC="Tiny HTTP and HTTPS proxy"
6case "$1" in
7autostart|start)
8 if [ -e /var/run/$NAME.pid ]; then
9 echo "$DESC: $NAME already started."
10 exit 0
11 fi
12 echo -n "Starting $DESC: $NAME"
13 test -e /var/run/$NAME.pid || touch /var/run/$NAME.pid
14 /usr/sbin/$NAME
15 echo "."
16 ;;
17
18 stop)
19 if [ ! -e /var/run/$NAME.pid ]; then
20 echo "$DESC: $NAME is not running."
21 exit 0
22 fi
23 echo -n "Stopping $DESC: $NAME"
24 killall $NAME
25 rm -f /var/run/$NAME.pid
26
27 echo "."
28 ;;
29
30 restart|force-reload)
31 if [ ! -e /var/run/$NAME.pid ]; then
32 $0 start
33 exit 0
34 fi
35 echo -n "Restarting $DESC: $NAME"
36 killall $NAME
37 sleep 1
38/usr/sbin/$NAME
39 echo "."
40 ;;
41
42 *)
43 N=/etc/init.d/$NAME
44 echo "Usage: $N {start|stop|restart|force-reload}" >&2
45 exit 1
46 ;;
47
48esac
49
50exit 0
Note: See TracBrowser for help on using the repository browser.