summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredy <aluque@soleta.eu>2018-07-05 13:16:35 +0200
committerFredy <aluque@soleta.eu>2018-07-05 13:16:35 +0200
commit01ae374d4e8099b0d3c87dce8e0a8c44856bdf4f (patch)
tree8c14b10b08d90158afff20e72dcf403fcbe5105d
parent872b044f789626b5532748c88fd9d26f551f0c3d (diff)
Added main repo interface parameter to sendFileMcast script to solve problems when more than one interface are available
-rwxr-xr-xrepoman/bin/getRepoIface9
-rwxr-xr-xrepoman/bin/sendFileMcast5
2 files changed, 12 insertions, 2 deletions
diff --git a/repoman/bin/getRepoIface b/repoman/bin/getRepoIface
new file mode 100755
index 00000000..2ce208be
--- /dev/null
+++ b/repoman/bin/getRepoIface
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# This script takes the IPlocal variable of the repository
+# and returns the system interface
+# Alfredo Luque <aluque@soleta.eu>
+
+source /opt/opengnsys/etc/ogAdmRepo.cfg
+
+ip addr show | grep $IPlocal | cut -f2 | awk '{ print $NF }'
diff --git a/repoman/bin/sendFileMcast b/repoman/bin/sendFileMcast
index ac6446d8..222a6d40 100755
--- a/repoman/bin/sendFileMcast
+++ b/repoman/bin/sendFileMcast
@@ -9,7 +9,8 @@ OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
OGIMG=$OPENGNSYS/images
OGBIN=$OPENGNSYS/bin
PATH=$PATH:$OGBIN
-
+REPO_IFACE="$(/opt/opengnsys/bin/getRepoIface)"
+
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
echo "Formato: $PROG fichero|nombreImagen datosMulticast"
@@ -57,5 +58,5 @@ CERROR="8x8/128"
# Envío de fichero por Multicast.
# Se desabilita el uso de mbuffer: eesta versión del upd-sender no la admite.
#which mbuffer &> /dev/null && MBUFFER="--pipe 'mbuffer -m 20M'"
-$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"
+$OGBIN/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --interface $REPO_IFACE --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG"