[FIXED] Se cambia la lógica para que copie todo el contenido de la carpeta /home/mrosero/.gnugp

This commit is contained in:
Mauro Rosero P. 2024-12-13 01:04:49 -05:00
parent 291799be6f
commit ce31c75cf9
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26
2 changed files with 11 additions and 8 deletions

View file

@ -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)

View file

@ -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,14 +158,16 @@ 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}/"
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
cd "${TMP_PATH}"