Skip to content

Commit 2ca133c

Browse files
committed
Fix docker-compose func break
1 parent 7c469cd commit 2ca133c

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

start.sh

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
11
#!/usr/bin/env bash
22
function check_sysctl() {
3-
ES_RECC_MIN_MAX_MAP_COUNT=262144
3+
ES_VM_MAX_MAP_COUNT_MIN=262144
44
ES_VM_MAX_MAP_COUNT=$(sysctl -n vm.max_map_count)
5-
if [ "$ES_VM_MAX_MAP_COUNT" -lt "$ES_RECC_MIN_MAX_MAP_COUNT" ]; then
6-
echo "vm.max_map_count=$ES_VM_MAX_MAP_COUNT is below ElasticSearch's recommended $ES_RECC_MIN_MAX_MAP_COUNT."
7-
echo "Recommend running \"sysctl -w vm.max_map_count=$ES_RECC_MIN_MAX_MAP_COUNT\""
8-
echo "Continuing will still work, but against recommended settings."
5+
if [ "$ES_VM_MAX_MAP_COUNT" -lt "$ES_VM_MAX_MAP_COUNT_MIN" ]; then
6+
echo "vm.max_map_count=$ES_VM_MAX_MAP_COUNT is below ElasticSearch's recommended $ES_VM_MAX_MAP_COUNT_MIN."
7+
echo "Recommend running \"sysctl -w vm.max_map_count=$ES_VM_MAX_MAP_COUNT_MIN\""
8+
echo "The system will still function, but against recommended settings."
99
read -p "Press [Enter] to continue."
1010
fi
1111
}
1212

13-
function docker_up() {
14-
COMPOSE_FILE=""
15-
case "$1" in
16-
""|"http")
17-
COMPOSE_FILE=docker-compose.yml
18-
;;
19-
"https")
20-
COMPOSE_FILE=docker-compose.https.yml
21-
;;
22-
*)
23-
echo $"Usage: $0 [http|https]"
24-
exit 1
25-
esac
26-
docker-compose -f $COMPOSE_FILE up -d --build
27-
}
28-
2913
UNAME="$(uname -s)"
3014
case "${UNAME}" in
3115
Linux*)
@@ -35,5 +19,19 @@ case "${UNAME}" in
3519
echo "Recommend running on Linux for production purposes."
3620
echo "YMMV on Windows or MacOS."
3721
sleep 5s
22+
;;
23+
esac
24+
COMPOSE_FILE=""
25+
case "$1" in
26+
""|"http")
27+
COMPOSE_FILE=docker-compose.yml
28+
;;
29+
"https")
30+
COMPOSE_FILE=docker-compose.https.yml
31+
;;
32+
*)
33+
echo $"Usage: $0 [http|https]"
34+
exit 1
35+
;;
3836
esac
39-
docker_up
37+
docker-compose -f $COMPOSE_FILE up -d --build

0 commit comments

Comments
 (0)