浏览代码

Minor changes

Sort list of services alphabetically; add custom services to list of services via custom.env
dennisro 5 年之前
父节点
当前提交
88e8f31eee
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      dockerbunker.sh

+ 6 - 1
dockerbunker.sh

@@ -54,9 +54,14 @@ declare -a ALL_SERVICES=( \
 	"Wordpress" \
 	)
 
+[[ -f "${ENV_DIR}"/custom.env ]] \
+	&& . "${ENV_DIR}"/custom.env
+
+IFS=$'\n' sorted=($(printf '%s\n' "${ALL_SERVICES[@]}"|sort))
+
 # style menu according to what status service has
 declare -A SERVICES_ARR
-for service in "${ALL_SERVICES[@]}";do
+for service in "${sorted[@]}";do
 	service_name="$(echo -e "${service,,}" | tr -cd '[:alnum:]')"
 	if [[ "${INSTALLED_SERVICES[@]}" =~ $service ]];then
 		[[ "${STOPPED_SERVICES[@]}" =~ $service ]] && service_status="$(printf "\e[32m${service}\e[0m \e[31m(Stopped)\e[0m")" || service_status="$(printf "\e[32m${service}\e[0m")"