diff --git a/docker/init.sh b/docker/init.sh index 960cc2e5de75b24164765e1c170537069b556492..9d33be3dcdddb4d50c9313a2d367c179b4dec3ac 100755 --- a/docker/init.sh +++ b/docker/init.sh @@ -29,10 +29,13 @@ # 2024-10-30 v1.22 <axel.hahn@unibe.ch> added: Open Mysql client in container # 2024-10-30 v1.23 <axel.hahn@unibe.ch> added: show menu hints why some menu items are visible # 2024-11-20 v1.24 <axel.hahn@unibe.ch> fix menu with started database less app; apply template permissions on target file; add $WEBURL; remove $frontendurl +# 2024-11-20 v1.25 <axel.hahn@unibe.ch> fix menu startup containers # ====================================================================== cd "$( dirname "$0" )" || exit 1 +_version="1.25" + # init used vars gittarget= WEBURL= @@ -42,7 +45,6 @@ _self=$( basename "$0" ) # shellcheck source=/dev/null . "${_self}.cfg" || exit 1 -_version="1.24" # git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git selfgitrepo="docker-php-starterkit.git" @@ -60,6 +62,7 @@ fgReset="\e[0m" # running containers DC_WEB_UP=0 DC_DB_UP=0 +DC_ALL_UP=0 # repo of docker-php-starterkit is here? DC_REPO=1 @@ -119,6 +122,8 @@ function _getStatus_docker(){ DC_WEB_UP=0 DC_DB_UP=0 + DC_ALL_UP=0 + grep -q "${APP_NAME}-server" <<< "$_out" && DC_WEB_UP=1 grep -q "${APP_NAME}-db" <<< "$_out" && DC_DB_UP=1 @@ -128,6 +133,14 @@ function _getStatus_docker(){ return fi + if [ "${DC_WEB_UP}" = "1" ] && [ "${DC_DB_UP}" = "1" ]; then + DC_ALL_UP=1 + fi + + if [ "$DB_ADD" = "false" ] && [ "${DC_WEB_UP}" = "1" ]; then + DC_ALL_UP=1 + fi + } # Get web url of the application @@ -204,9 +217,7 @@ function showMenu(){ echo "${_spacer}$( _key T ) - remove generated files" echo fi - if [ $DC_WEB_UP -eq 0 ] \ - || [ $DC_DB_UP -eq 0 ] && [ ! "$DB_ADD" = "false" ] \ - || [ $_bAll -eq 1 \ + if [ $DC_ALL_UP -eq 0 ] || [ $_bAll -eq 1 \ ]; then if [ $DC_CONFIG_CHANGED -eq 0 ] || [ $_bAll -eq 1 ]; then menuhint $_bAll "A container is down and config is unchanged" diff --git a/docs/images/main_menu.png b/docs/images/main_menu.png index 176508c68c3d0cb7a05c4bcbf8c26bc53d4e502a..907827d8c8c98580a9bb68330b465575361f3bda 100644 Binary files a/docs/images/main_menu.png and b/docs/images/main_menu.png differ diff --git a/docs/images/main_menu_running_web.png b/docs/images/main_menu_running_web.png new file mode 100644 index 0000000000000000000000000000000000000000..dbeec740006295f3cd57b8a8a060e75ef8825dbb Binary files /dev/null and b/docs/images/main_menu_running_web.png differ