source: repoman/bin/sendFileMcast @ a012113

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
Last change on this file since a012113 was 9dbaa9e7, checked in by irina <irinagomez@…>, 12 years ago

sendFileMcast: ttl a 16, resuelve problema multicast en algunas redes

git-svn-id: https://opengnsys.es/svn/branches/version1.0@3948 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 2.1 KB
RevLine 
[85b029f]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
7PROG=$(basename $0)
[526298b]8OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
9OGIMG=$OPENGNSYS/images
10OGBIN=$OPENGNSYS/bin
11PATH=$PATH:$OGBIN
[85b029f]12 
13# Si se solicita, mostrar ayuda.
14if [ "$*" == "help" ]; then
[526298b]15    echo "Formato: $PROG fichero|nombreImagen datosMulticast"
[cdc5f1f]16    echo "Ejemplo: $PROG /opt/opengnsys/images/imagen1.pgz 9000:full-duplex:239.194.17.2:70M:20:120"
17    echo "Ejemplo: $PROG imagen1 9000:full:239.194.17.2:70M:20:120"
[85b029f]18    exit 0
19fi
20# Error si no se reciben 2 parámetros.
21if [ $# -ne 2 ]; then
[e8460d2]22    echo "$PROG Error: Formato: $PROG fichero|nombreImagen datosMulticast"
[85b029f]23    exit 1
24fi
25
[bfc4d9c]26# Fichero a enviar (camino completo o relativo al directorio del repositorio).
[526298b]27FICH="$1"
[e031dd38]28if [ "${FICH:0:15}" != "$OPENGNSYS" ]; then
[bfc4d9c]29    FICHIMG="$OGIMG/$FICH"
[cdc5f1f]30else
31    FICHIMG="$FICH"
32fi
[3f9764a]33if [ ! -f "$FICHIMG" ]; then
[bfc4d9c]34    echo "$PROG Error: Fichero \"$FICHIMG\" no accesible"
[526298b]35    exit 2
36fi
37
[85b029f]38# Parámetros de sesión separado por ":".
[fd11e20]39PARAMS=$(echo $2 | \
40        awk -F: '$1~/^[0-9]*$/ {print $1}
41                 tolower($2)~/^(half)(-duplex)?$/ {print "half-duplex"}
42                 tolower($2)~/^(full)(-duplex)?$/ {print "full-duplex"}
43                 $3~/^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$/ {print $3}
[526298b]44                 $4~/^[0-9]*[mM]/ {print toupper($4)}
[fd11e20]45                 $5~/^[0-9]*/ {print $5}
[526298b]46                 $6~/^[0-9]*/ {print $6}
[fd11e20]47                ')
48read -e PORTBASE METHOD ADDRESS BITRATE NCLIENTS MAXTIME <<< $PARAMS
[526298b]49if [ -z "$MAXTIME" ]; then
[e8460d2]50    echo "$PROG Error: Datos de sesión incorrectos: \"$2\""
51    exit 3
[526298b]52fi
[85b029f]53
[fd11e20]54# Valores estandar no configurables.
55CERROR="8x8/128"
[85b029f]56
57# Envío de fichero por Multicast.
[c66eccd]58# Se desabilita el uso de mbuffer: eesta versión del upd-sender no la admite.
59#which mbuffer &> /dev/null && MBUFFER="--pipe 'mbuffer -m 20M'"
[9dbaa9e7]60$OGBIN/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG"
[3cd3133]61
Note: See TracBrowser for help on using the repository browser.