|
@@ -13,15 +13,20 @@ options_menu() {
|
|
|
# if service is marked as installed, make sure all containers exist and offer to run them if necessary
|
|
|
if elementInArray "${PROPER_NAME}" "${INSTALLED_SERVICES[@]}";then
|
|
|
for container in "${containers[@]}";do
|
|
|
- RUNNING=$(docker ps -a -q --filter name=^/${container}$)
|
|
|
- echo "Status: $RUNNING"
|
|
|
- if [[ -z ${RUNNING} ]];then
|
|
|
+ RUNNING=$(docker ps -a -q --filter name=^/${container}$ --filter status=running)
|
|
|
+ EXITED=$(docker ps -a -q --filter name=^/${container}$ --filter status=exited)
|
|
|
+ [[ ${RUNNING} ]] && echo "Running: $RUNNING"
|
|
|
+ [[ ${EXITED} ]] && echo "Exited: $EXITED"
|
|
|
+ if [[ -z ${RUNNING} && -z ${EXITED} ]];then
|
|
|
echo -e "\n\e[3m$container container missing\e[0m\n"
|
|
|
missingContainers=( "$container" )
|
|
|
prompt_confirm "Restore $container?"
|
|
|
if [[ $? == 0 ]];then
|
|
|
restore_container
|
|
|
fi
|
|
|
+ elif [[ ${EXITED} ]];then
|
|
|
+ echo -e "\n\e[3mRestarting $container\e[0m\n"
|
|
|
+ docker restart ${container} >/dev/null 2>&1
|
|
|
fi
|
|
|
RUNNING=$(docker ps -a -q --filter name=^/${container}$)
|
|
|
[[ ${RUNNING} ]] && missingContainers=( "${missingContainers[@]}/$container" )
|
|
@@ -526,12 +531,12 @@ remove_ssl_certificate() {
|
|
|
&& echo -en "\n\e[1mRemoving SSL Certificates\e[0m" \
|
|
|
&& rm -r "${CONF_DIR}"/nginx/ssl/${SERVICE_DOMAIN[0]} \
|
|
|
&& exit_response
|
|
|
- [[ -f "${CONF_DIR}"/nginx/ssl/letsencrypt/renewal/${SERVICE_DOMAIN[0]}.conf ]] \
|
|
|
- && rm "${CONF_DIR}"/nginx/ssl/letsencrypt/renewal/${SERVICE_DOMAIN[0]}.conf
|
|
|
- [[ -d "${CONF_DIR}"/nginx/ssl/letsencrypt/archive/${SERVICE_DOMAIN[0]} ]] \
|
|
|
- && rm -r "${CONF_DIR}"/nginx/ssl/letsencrypt/archive/${SERVICE_DOMAIN[0]}
|
|
|
- [[ -d "${CONF_DIR}"/nginx/ssl/letsencrypt/live/${SERVICE_DOMAIN[0]} ]] \
|
|
|
- && rm -r "${CONF_DIR}"/nginx/ssl/letsencrypt/live/${SERVICE_DOMAIN[0]}
|
|
|
+# [[ -f "${CONF_DIR}"/nginx/ssl/letsencrypt/renewal/${SERVICE_DOMAIN[0]}.conf ]] \
|
|
|
+# && rm "${CONF_DIR}"/nginx/ssl/letsencrypt/renewal/${SERVICE_DOMAIN[0]}.conf
|
|
|
+# [[ -d "${CONF_DIR}"/nginx/ssl/letsencrypt/archive/${SERVICE_DOMAIN[0]} ]] \
|
|
|
+# && rm -r "${CONF_DIR}"/nginx/ssl/letsencrypt/archive/${SERVICE_DOMAIN[0]}
|
|
|
+# [[ -d "${CONF_DIR}"/nginx/ssl/letsencrypt/live/${SERVICE_DOMAIN[0]} ]] \
|
|
|
+# && rm -r "${CONF_DIR}"/nginx/ssl/letsencrypt/live/${SERVICE_DOMAIN[0]}
|
|
|
fi
|
|
|
}
|
|
|
|
|
@@ -598,15 +603,15 @@ upgrade() {
|
|
|
pull_and_compare
|
|
|
|
|
|
stop_containers
|
|
|
+
|
|
|
remove_containers
|
|
|
|
|
|
docker_run_all
|
|
|
|
|
|
- remove_from_STOPPED_SERVICES
|
|
|
-
|
|
|
delete_old_images
|
|
|
-
|
|
|
+
|
|
|
activate_nginx_conf
|
|
|
+ remove_from_STOPPED_SERVICES
|
|
|
|
|
|
restart_nginx
|
|
|
}
|