diff options
author | ramon <ramongomez@us.es> | 2011-10-03 10:49:44 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-10-03 10:49:44 +0000 |
commit | d16b7cff6126323ccd05f0f4597c162f46ad0432 (patch) | |
tree | c6c6dcc4c6aed6d2b917915a8cdc8e7e3c1c255d /server/bin/setclientmode | |
parent | 85f46797542b7f56ea99e69451b3c2c9166b4d01 (diff) |
Versión 1.0.2: comando {{{setclientmode}}} actualiza los datos de red usando los valores de la base de datos (modifica #444)
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2334 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'server/bin/setclientmode')
-rwxr-xr-x | server/bin/setclientmode | 11 |
1 files changed, 11 insertions, 0 deletions
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 |