feature(RESTORE): stop docker containers and confirm

This commit is contained in:
Asif Bacchus 2021-02-08 11:30:39 -07:00
parent bf18c80f94
commit c9b85d084e

View File

@ -346,7 +346,16 @@ if [ "$restoreSQL" -eq 1 ]; then
fi
fi
#TODO: stop containers
### stop containers (necessary for all restore operations except SQL)
if ! docker-compose down > /dev/null 2>&1; then
writeLog 'error' '20' "Unable to bring mailcow containers down -- cannot reliably restore. Aborting."
exitError 20
fi
if [ "$( docker ps --filter "name=${COMPOSE_PROJECT_NAME}" -q | wc -l )" -gt 0 ]; then
writeLog 'error' '20' "Unable to bring mailcow containers down -- cannot reliably restore. Aborting."
exitError 20
fi
#TODO: copy backups to correct docker volumes
#TODO: restart docker containers
#TODO: optionally reindex dovecot (parameter)