Commit a874ec99 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci

postinst: Modified to restore the inep and proxy files

Restore them in case they already existed from a previously configured
PROINFODATA installation.
Signed-off-by: 's avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: 's avatarAryane Ast dos Santos <aras10@c3sl.ufpr.br>
parent 3f8a0f1c
......@@ -22,6 +22,26 @@
# This is the postinst of proinfodata
SEED_MEC_HOME="/opt/seed_mec"
BACKUP_DIR="/opt/seed_mec_backup"
# Check if there is a backup for the inep and proxy files and restore it
if test -f "${BACKUP_DIR}/SEED2/client/conf/inep"; then
# Restore the inep and proxy files, and also their backup and md5sum
# counterparts
for FILE in "proxy" "inep"; do
cp -af "${BACKUP_DIR}/SEED2/.backup/client/conf/${FILE}" \
"${SEED_MEC_HOME}/SEED2/.backup/client/conf/${FILE}"
cp -af "${BACKUP_DIR}/SEED2/.md5sum/client/conf/${FILE}" \
"${SEED_MEC_HOME}/SEED2/.md5sum/client/conf/${FILE}"
cp -af "${BACKUP_DIR}/SEED2/.md5sum/.backup/client/conf/${FILE}" \
"${SEED_MEC_HOME}/SEED2/.md5sum/.backup/client/conf/${FILE}"
cp -af "${BACKUP_DIR}/SEED2/client/conf/${FILE}" \
"${SEED_MEC_HOME}/SEED2/client/conf/${FILE}"
done
# Remove the auxiliar directory
rm -rf "${BACKUP_DIR}"
fi
# Make sure the owner of ~seed_mec is seed_mec
chown -R seed_mec:seed_mec "${SEED_MEC_HOME}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment