[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}" dialog_yesno "${gpmsg_105}"
case ${result} in case ${result} in
0) 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=$? rc=$?
case $rc in case $rc in
0) 0)

View file

@ -103,6 +103,7 @@ function gpg_backup() {
local DB_BACKUP=$1 local DB_BACKUP=$1
local BIN_CONFIG=$2 local BIN_CONFIG=$2
local TIMESTAMP=$3 local TIMESTAMP=$3
local GNUGP_PATH=$4
local rc=0 local rc=0
# Check if backup configuration file exists # Check if backup configuration file exists
@ -157,14 +158,16 @@ function gpg_backup() {
fi fi
# Copiar los archivos de revocación # Copiar los archivos de revocación
local REVOKE_PATH="${GNUPGHOME:-$GPG_DEFAULT_PATH}/openpgp-revocs.d" mkdir ${TMP_PATH}/gnugp
cp -rf "${REVOKE_PATH}"/${GPG_REVOKE_FILES} "${TMP_PATH}/" if [ $? -eq 0 ]; then
cp -rf $GNUGP_PATH/* ${TMP_PATH}/gnugp
rc=$? rc=$?
if [ $rc -ne 0 ] if [ $rc -ne 0 ]
then then
rm -rf "${TMP_PATH}" rm -rf "${TMP_PATH}"
return $rc return $rc
fi fi
fi
# Cambiar el directorio de trabajo a la carpeta temporal para poder hacer el empaquetamiento zip # Cambiar el directorio de trabajo a la carpeta temporal para poder hacer el empaquetamiento zip
cd "${TMP_PATH}" cd "${TMP_PATH}"