3 # assemble transmission texts from clean texts
5 # environment variables ROOTDIR and SCRIPTDIR must be defined by caller,
6 # and script must be called from channel directory as working directory
8 .
$SCRIPTDIR/constants.sh
10 # save channel name for reference - but we should already be in that directory
14 logf
=`logfile $myself`
15 statf
=$STATUSDIR/$myself
17 statrep
$statf STATUS initializing
19 # check if config file present, if not, sleep to reduce load
20 if ! -r $CHANNELCONFIG
22 logit
$logf FAIL missing config
file $CHANNELCONFIG
23 statrep
$statf STATUS FAIL missing config
file $CHANNELCONFIG
28 # check if prefix defined -- we cannot define it here by ourselves!
29 if ! prefix
=`configread $CHANNELCONFIG PREFIX`
31 logit
$logf FAIL missing PREFIX definition
in $CHANNELCONFIG
32 statrep
$statf STATUS FAIL missing PREFIX definition
in $CHANNELCONFIG
37 # handler for restarting/reloading
39 logit
$logf signal reloading configuration files and restarting
42 # flag initially _set_ to force initializing during launch
43 # will be reset after initialization routine
45 trap restart
$SIGDAEMONRESTART
47 # handler for stopping
49 logit
$logf signal finishing
53 trap finish
$SIGDAEMONTERMINATE
55 while test ABORTPLANNER
-eq 0
56 # reduce load in case of severe bugs/problems
58 if test $RESTARTPLANNER -eq 1
60 sources
=`configread $CHANNELCONFIG SOURCES ',:;'`
61 logit
$logf config sources
: $sources"
62 # last resource default: no postprocessor, i.e `cat`
63 postprocessor=`configread $CHANNELCONFIG POSTPROCESSOR`
64 postprocessor=${postprocessor:-/bin/cat}
65 logit $logf config postprocessor: $postprocessor
66 # last resource defaults: ToC length 2min, ToC retransmission period 3 slices
67 toclength=`configread $CHANNELCONFIG TOCLENGTH`
68 toclength=${toclength:-120}
69 tocslices=`configread $CHANNELCONFIG TOCSLICES`
70 tocslices=${tocslices:-3}
71 # do not restart until signal received again