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