source: freewrt/package/rrdcollect/files/rrdcollect.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 100644
File size: 541 bytes
Line 
1#!/bin/sh
2
3BIN=rrdcollect
4DEFAULT=/etc/default/$BIN
5RUN_D=/var/run
6PID_F=$RUN_D/$BIN.pid
7LIB_D=/var/lib/rrdcollect
8CGI_S=$LIB_D/rrd.cgi
9IMG_D=$LIB_D/img
10RRD_D=$LIB_D/rrd
11RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
12[ -f $DEFAULT ] && . $DEFAULT
13
14case $1 in
15autostart|start)
16 mkdir -p $RUN_D
17 mkdir -p $IMG_D
18 mkdir -p $RRD_D
19 [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
20 [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
21 $BIN $OPTIONS
22 ;;
23 stop)
24 [ -f $PID_F ] && kill $(cat $PID_F)
25 ;;
26 *)
27 echo "usage: $0 (start|stop)"
28 exit 1
29esac
30
31exit $?
Note: See TracBrowser for help on using the repository browser.