summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_update.sh
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-01-31 09:33:55 +0100
committerRamón M. Gómez <ramongomez@us.es>2020-01-31 09:33:55 +0100
commit8f24716a0b08cf8356ad2194e1c261e5f5e8cc01 (patch)
tree4ac0ba78eebd33722fdad17febce892d92df0df4 /installer/opengnsys_update.sh
parent58f59cee1e9575be4a051af5f4721f9516f0f61a (diff)
#946: Add API token to the ogAdmServer configuration file, if needed.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-xinstaller/opengnsys_update.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index f249d62f..0b2fe4cd 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -979,7 +979,7 @@ function updateServerFiles()
" } else {\n"\
" filename \"grldr\";\n"\
" }"
- sed -i -e 2i"option arch code 93 = unsigned integer 16;" -e s@"^.*grldr\"\;"@"$UEFICFG"@g /etc/dhcp*/dhcpd*.conf
+ sed -i -e 1i"option arch code 93 = unsigned integer 16;" -e s@"^.*grldr\"\;"@"$UEFICFG"@g /etc/dhcp*/dhcpd*.conf
service=$DHCPSERV; $STARTSERVICE
NEWFILES="/etc/dhcp*/dhcpd*.conf"
fi
@@ -1014,7 +1014,6 @@ function updateServerFiles()
[ ! -f /etc/cron.d/torrenttracker ] && echo "5 * * * * root [ -x $INSTALL_TARGET/bin/torrent-tracker ] && $INSTALL_TARGET/bin/torrent-tracker" > /etc/cron.d/torrenttracker
[ ! -f /etc/cron.d/imagedelete ] && echo "* * * * * root [ -x $INSTALL_TARGET/bin/deletepreimage ] && $INSTALL_TARGET/bin/deletepreimage" > /etc/cron.d/imagedelete
[ ! -f /etc/cron.d/ogagentqueue ] && echo "* * * * * root [ -x $INSTALL_TARGET/bin/ogagentqueue.cron ] && $INSTALL_TARGET/bin/ogagentqueue.cron" > /etc/cron.d/ogagentqueue
- echoAndLog "${FUNCNAME}(): server files successfully updated"
# Se modifican los nombres de las plantilla PXE por compatibilidad con los equipos UEFI.
if [ -f $INSTALL_TARGET/tftpboot/menu.lst/templates/01 ]; then
@@ -1022,6 +1021,7 @@ function updateServerFiles()
mv $BIOSPXEDIR/01 $BIOSPXEDIR/10
sed -i "s/\bMBR\b/1hd/" $BIOSPXEDIR/10
fi
+ echoAndLog "${FUNCNAME}(): server files successfully updated"
}
####################################################################
@@ -1084,6 +1084,9 @@ function compileServices()
hayErrores=1
fi
popd
+ # Generar un API token de ogAdmServer si no existe en el fichero de configuración.
+ grep -q "APITOKEN=" $INSTALL_TARGET/etc/ogAdmServer.cfg || \
+ $INSTALL_TARGET/bin/settoken server <<<"y"
return $hayErrores
}