diff options
author | ramon <ramongomez@us.es> | 2014-07-10 09:29:10 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2014-07-10 09:29:10 +0000 |
commit | 2cbfd3f29191e996e6efe093484fcc14f6c433fa (patch) | |
tree | 8deb2ba3bbcf1fdb7d037abb143bc181f711a1aa /server/bin | |
parent | 1bbff4989dcd84ef8511102dc3df0a5ea31a503c (diff) |
Script {{{setserveraddr}}} permite cambiar de interfaz aunque no hayan cambiado los datos de configuraciĆ³n de red.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4341 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'server/bin')
-rwxr-xr-x | server/bin/setserveraddr | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/server/bin/setserveraddr b/server/bin/setserveraddr index 80015bbc..7a8a1acc 100755 --- a/server/bin/setserveraddr +++ b/server/bin/setserveraddr @@ -66,7 +66,7 @@ if [ -n "$SERVERIP" ]; then [ -x $f ] && $f restart done else - echo "Don't change the DHCP configuration." + echo "DHCP configuration has not changed." fi # Guardar la IP anterior del repositorio. @@ -90,10 +90,10 @@ if [ -n "$SERVERIP" ]; then -e "s,IPlocal=.*,IPlocal=$SERVERIP," \ -e '/localhost/!s,http://[^/]*/\(.*\),http://'$SERVERIP'/\1,' $f >$tmpfile file="${f/./-$1.}" - # Copiar el fichero y enlazarlo si hay cambios. - if ! diff -q $tmpfile $file &>/dev/null; then - mv $tmpfile $file - chmod 644 $file + # Si se usa otro interfaz o cambian los datos de red; ... + if [ ! $f -ef $file ] || ! diff -q $tmpfile $file &>/dev/null; then + # Copiar el fichero y enlazarlo. + cp $tmpfile $file ln -f $file $f CHANGE=1 fi @@ -134,7 +134,7 @@ Log-in as Web Console organization user. EOT else # Mensaje indicando que no se han cambiado datos. - echo "Don't change the default interface: $1" + echo "Default interface has not changed: $1" fi else # Error: interfaz de red no encontrado. @@ -142,3 +142,6 @@ else exit 1 fi +# Eliminar ficheros temporales. +rm -f $tmpfile $MYCNF + |