File: rc.cron

package info (click to toggle)
radiuscontext 1.76-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 176 kB
  • ctags: 135
  • sloc: python: 1,120; perl: 57; sh: 50; makefile: 40
file content (53 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
#!/bin/sh
#
#  Sample script, suitable for calling from cron, which updates reports.
#  Change the RCDIR and DATADIR variables to indicate where the binaries
#  and reports are located.  It also creates HTML index files for the
#  RAW and Text reports with HREFs to individual user entries.
#
#  Contributed by Richard A. Soderberg, June 1998
#  Changes to make more general by Sean Reifschneider, June 1998

#####################################
#  location of radiusContext programs
RCDIR=/usr/local/etc/radiusContext

#################################################
#  location to store session database and reports
DATADIR=/usr/local/etc/radiusContext/reports

########################################################################
#  location of radius detail files (which may reside in sub-directories)
RADDIR=/usr/private/etc/radacct

###############################
#  ownership and modes for data
REPOWN=root:www
umask 022             #  reports writable only for owner
DBOWN=root:root
DBPERM=660


###########################################
#  No user-servicable parts below this line
echo "[`date +%H:%M`] Updating database."
${RCDIR}/samples/updatedb.pl
chown ${DBOWN} ${DATADIR}/SessionData*
chmod ${DBPERM} ${DATADIR}/SessionData*

echo "[`date +%H:%M`] Generating reports."
mkdir ${DATADIR} ${DATADIR}/HTML ${DATADIR}/Text ${DATADIR}/Raw \
    ${DATADIR}/CSV 2>/dev/null
${RCDIR}/stdreport -d ${DATADIR}/SessionData -H ${DATADIR}/HTML \
    -T ${DATADIR}/Text -R ${DATADIR}/Raw -C ${DATADIR}/CSV

echo "[`date +%H:%M`] Converting indexes to HTML."
cd ${DATADIR}/Text
${RCDIR}/samples/TextIndexToHTML.pl
cd ${DATADIR}/Raw
${RCDIR}/samples/RawIndexToHTML.pl

echo "[`date +%H:%M`] Restoring permissions."
/bin/chown -R ${REPOWN} ${DATADIR}/HTML ${DATADIR}/Text ${DATADIR}/Raw \
    ${DATADIR}/CSV
echo "[`date +%H:%M`] Done."