aboutsummaryrefslogtreecommitdiffstats
path: root/start-mux-mod.sh
blob: c7f248908d6aa02d04b1b7dcc417bcc33eaed9d8 (plain)
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
#!/bin/bash
#
# Launch the multiplexer and the modulator

if [[ -e site/multiplex.mux && -e site/mod.ini && site/mail-warning.txt ]]
then

    while true
    do
        odr-dabmux -e site/multiplex.mux | sudo odr-dabmod -C site/mod.ini
        R=$?

        MAILTO=$(cat site/mail-warning.txt)

        if [[ "$MAILTO" != "" ]] ; then
            NOW=$(date)
            mail -s "MUX and MOD restart" $MAILTO << EOF
The mux and mod were restarted at
$NOW

The return code was $R

EOF

        fi

        sleep 15
    done
else
    echo "Incomplete site configuration !"
    echo "Check that the site/ folder exists"
    exit 1
fi