diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-10-16 10:20:16 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-10-16 10:20:16 +0200 |
commit | fbc73330cd32f55c406b9f3453329bd488209667 (patch) | |
tree | d8c1dedf89ebe578c96bfee8b8e116ade3c83b5b /installer/opengnsys_update.sh | |
parent | 576c9e6958a4f016d2a3fda6251ca95caee7423f (diff) |
#846: Update script creates logrotate files if they do not exist.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-x | installer/opengnsys_update.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 8ebd4080..89939752 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -1014,17 +1014,31 @@ function updateClient() # Comprobar permisos y ficheros. function checkFiles() { + local LOGROTATEDIR=/etc/logrotate.d + # Comprobar permisos adecuados. if [ -x $INSTALL_TARGET/bin/checkperms ]; then echoAndLog "${FUNCNAME}(): Checking permissions" OPENGNSYS_DIR="$INSTALL_TARGET" OPENGNSYS_USER="$OPENGNSYS_CLIENTUSER" APACHE_USER="$APACHE_RUN_USER" APACHE_GROUP="$APACHE_RUN_GROUP" $INSTALL_TARGET/bin/checkperms fi - # Eliminamos el fichero de estado del tracker porque es incompatible entre los distintos paquetes if [ -f /tmp/dstate ]; then echoAndLog "${FUNCNAME}(): Deleting unused files" rm -f /tmp/dstate fi + # Crear ficheros de logrotate. + if [ -d $LOGROTATEDIR ]; then + if [ ! -f $LOGROTATEDIR/opengnsysServer ]; then + echoAndLog "${FUNCNAME}(): Creating logrotate configuration file for server" + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/logrotate.tmpl > $LOGROTATEDIR/opengnsysServer + fi + if [ ! -f $LOGROTATEDIR/opengnsysRepo ]; then + echoAndLog "${FUNCNAME}(): Creating logrotate configuration file for repository" + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/logrotate.tmpl > $LOGROTATEDIR/opengnsysRepo + fi + fi } # Resumen de actualización. |