From d16b7cff6126323ccd05f0f4597c162f46ad0432 Mon Sep 17 00:00:00 2001 From: ramon Date: Mon, 3 Oct 2011 10:49:44 +0000 Subject: Versión 1.0.2: comando {{{setclientmode}}} actualiza los datos de red usando los valores de la base de datos (modifica #444) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.0@2334 a21b9725-9963-47de-94b9-378ad31fedc9 --- server/bin/setclientmode | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/bin/setclientmode') diff --git a/server/bin/setclientmode b/server/bin/setclientmode index f02dc72f..aca27f40 100755 --- a/server/bin/setclientmode +++ b/server/bin/setclientmode @@ -60,6 +60,17 @@ for AUX in $ETHERNET; do [ -e $PXEDIR/$AUX ] && rm $PXEDIR/$AUX if [ "$1" != "default" ]; then cp -a $TEMPLATE $PXEDIR/$AUX + DATOS=$(mysql -u "$USUARIO" -p"$PASSWORD" -D "$CATALOG" -N -e \ + "SELECT ordenadores.ip, ':', repositorios.ip, ':', + aulas.router, ':', aulas.netmask, ':', + ordenadores.netiface, ':none group=', + REPLACE (aulas.nombreaula, ' ', '_') + FROM ordenadores + JOIN aulas ON ordenadores.idaula=aulas.idaula + JOIN repositorios ON ordenadores.idrepositorio=repositorios.idrepositorio + WHERE ordenadores.mac=\"$ETHERNET\";") + DATOS=$(echo ${DATOS// /} | tr 'áéíóúñÁÉÍÓÚÑ' 'aeiounAEIOUN') + perl -pi -e "s/INFOHOST/$DATOS/" $PXEDIR/$AUX mysql -u "$USUARIO" -p"$PASSWORD" -D "$CATALOG" -N -e \ "UPDATE ordenadores SET arranque=\"$1\" WHERE mac=\"$ETHERNET\";" fi -- cgit v1.2.3-18-g5258