-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmumudvb.sh
executable file
·44 lines (36 loc) · 987 Bytes
/
mumudvb.sh
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
#!/usr/bin/env bash
##
# Lancement de diffusion d'un multiplex avec mumudvb
#
# @param string $1 nom du multplex
#
# source: https://aerogus.net/posts/diffuser-tele-radio-reseau-local/
##
ABS_PATH="$( cd "$(dirname "$0")" || return; pwd -P )"
CONF_PATH="${ABS_PATH}/conf/mumudvb"
ALLOWED_CARDS=(0 1 2 3 4 5 6 7)
if [[ ! $(command -v mumudvb) ]]; then
echo "commande mumudvb manquante";
echo "apt install mumudvb"
exit 1;
fi
if [[ $# -lt 1 ]]; then
echo "paramètre card_mux manquant";
echo "usage: ./mumudvb.sh 0_r1"
echo " 0 = le numéro de l'adaptateur sdr"
echo "r1 = le nom du multiplex"
exit 1;
fi
CARD=${1:0:1}
MUX=${1#*_}
if ! echo "${ALLOWED_CARDS[@]}" | grep -q "$CARD"; then
echo "card $CARD non autorisé"
echo "cards autorisées: "
echo "${ALLOWED_CARDS[@]}"
exit 1;
fi
if [[ ! -f "${CONF_PATH}/$MUX.conf" ]]; then
echo "fichier ${CONF_PATH}/$MUX.conf manquant";
exit 1;
fi
mumudvb --card "$CARD" --debug --config "${CONF_PATH}/$MUX.conf"