From ce31c75cf9c300ed9751482fb2b4bf27941632a2 Mon Sep 17 00:00:00 2001 From: Mauro Rosero P Date: Fri, 13 Dec 2024 01:04:49 -0500 Subject: [PATCH] =?UTF-8?q?[FIXED]=20Se=20cambia=20la=20l=C3=B3gica=20para?= =?UTF-8?q?=20que=20copie=20todo=20el=20contenido=20de=20la=20carpeta=20/h?= =?UTF-8?q?ome/mrosero/.gnugp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/gpg_backup.sh | 2 +- bin/lib/gpg.lib | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/gpg_backup.sh b/bin/gpg_backup.sh index af36faa..e6ff86e 100755 --- a/bin/gpg_backup.sh +++ b/bin/gpg_backup.sh @@ -82,7 +82,7 @@ fi dialog_yesno "${gpmsg_105}" case ${result} in 0) - gpg_backup "$DB_GPG_PATH/$DB_GPG_FILE" "$BIN_HOME/$GPG_CONFIG_PATH" "$DATEBAK" + gpg_backup "$DB_GPG_PATH/$DB_GPG_FILE" "$BIN_HOME/$GPG_CONFIG_PATH" "$DATEBAK" "$GPG_DEFAULT_PATH" rc=$? case $rc in 0) diff --git a/bin/lib/gpg.lib b/bin/lib/gpg.lib index 84069b0..2ddb36d 100644 --- a/bin/lib/gpg.lib +++ b/bin/lib/gpg.lib @@ -103,6 +103,7 @@ function gpg_backup() { local DB_BACKUP=$1 local BIN_CONFIG=$2 local TIMESTAMP=$3 + local GNUGP_PATH=$4 local rc=0 # Check if backup configuration file exists @@ -157,13 +158,15 @@ function gpg_backup() { fi # Copiar los archivos de revocaciĆ³n - local REVOKE_PATH="${GNUPGHOME:-$GPG_DEFAULT_PATH}/openpgp-revocs.d" - cp -rf "${REVOKE_PATH}"/${GPG_REVOKE_FILES} "${TMP_PATH}/" - rc=$? - if [ $rc -ne 0 ] - then - rm -rf "${TMP_PATH}" - return $rc + mkdir ${TMP_PATH}/gnugp + if [ $? -eq 0 ]; then + cp -rf $GNUGP_PATH/* ${TMP_PATH}/gnugp + rc=$? + if [ $rc -ne 0 ] + then + rm -rf "${TMP_PATH}" + return $rc + fi fi # Cambiar el directorio de trabajo a la carpeta temporal para poder hacer el empaquetamiento zip