aboutsummaryrefslogtreecommitdiffstats
path: root/start-mux-mod.sh
diff options
context:
space:
mode:
Diffstat (limited to 'start-mux-mod.sh')
-rwxr-xr-xstart-mux-mod.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/start-mux-mod.sh b/start-mux-mod.sh
new file mode 100755
index 0000000..c7f2489
--- /dev/null
+++ b/start-mux-mod.sh
@@ -0,0 +1,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
+