File: postinst

package info (click to toggle)
queuegraph 1.1.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 68 kB
  • ctags: 4
  • sloc: perl: 129; sh: 97; makefile: 35
file content (47 lines) | stat: -rw-r--r-- 949 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

set -e

DATADIR=/var/lib/queuegraph
CACHEDIR=/var/cache/queuegraph
CGIDIR=/usr/lib/cgi-bin

case "$1" in 
   configure)

   mkdir -p $DATADIR $CACHEDIR
   chown root:root $DATADIR
   chown www-data:www-data $CACHEDIR

   chown root:root $CGIDIR/queuegraph.cgi

   if [ -f $DATADIR/queuegraph.rrd ]; then	
      echo "RRD database already exists, skipping creation"
   else   
      rrdtool create $DATADIR/queuegraph.rrd --step 60 \
          DS:active:GAUGE:900:0:U \
          DS:deferred:GAUGE:900:0:U \
          RRA:AVERAGE:0.5:1:20160 \
          RRA:AVERAGE:0.5:30:2016 \
          RRA:AVERAGE:0.5:60:105120 \
          RRA:MAX:0.5:1:1440 \
          RRA:MAX:0.5:30:2016 \
          RRA:MAX:0.5:60:105120
      chmod 644 $DATADIR/queuegraph.rrd
   fi   
   ;;
   
   abort-upgrade|abort-remove|abort-deconfigure)

   ;;

   *)
      echo "postinst called with unknown argument $1" >&2
      exit 1
   ;;

esac

exit 0

#DEBHELPER#