918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Line | |
---|
1 | #!/bin/bash |
---|
2 | #@brief Envía un fichero por multicast ORIGEN(fichero) DESTINO(sessionmulticast) |
---|
3 | #@param path_file Camino completo del fichero a enviar |
---|
4 | #@param str_session Datos de sesión (Puerto:Duplex:IP:Mpbs:Nclientes:Timeout) |
---|
5 | |
---|
6 | |
---|
7 | PROG=$(basename $0) |
---|
8 | |
---|
9 | # Si se solicita, mostrar ayuda. |
---|
10 | if [ "$*" == "help" ]; then |
---|
11 | echo "Formato: $PROG fichero datosMulticast" |
---|
12 | echo "Ejemplo: $PROG /opt/opengnsys/images/PS1_PH1.img 9000:full-duplex:239.194.17.2:70M:20:300" |
---|
13 | exit 0 |
---|
14 | fi |
---|
15 | # Error si no se reciben 2 parámetros. |
---|
16 | if [ $# -ne 2 ]; then |
---|
17 | echo "Error: Formato: $PROG fichero datosMulticast" >&2 |
---|
18 | exit 1 |
---|
19 | fi |
---|
20 | |
---|
21 | # Parámetros de sesión separado por ":". |
---|
22 | OIFS=$IFS; IFS=':' |
---|
23 | read -e PORTBASE METHOD ADDRESS BITRATE NCLIENTS MAXTIME <<<"$2" |
---|
24 | IFS=$OIFS |
---|
25 | |
---|
26 | # FIXME Comprobación consistencia de parámetros. |
---|
27 | |
---|
28 | # Envío de fichero por Multicast. |
---|
29 | which mbuffer &> /dev/null && MBUFFER="--pipe 'mbuffer -m 20M'" |
---|
30 | udp-sender $MBUFFER --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 1 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$1" |
---|
31 | |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.