@@ -3,7 +3,7 @@ export MSYS_NO_PATHCONV=1
33export DOCKERHOST=${APPLICATION_URL-$(docker run --rm --net=host eclipse/ che-ip)}
44SCRIPT_HOME=" $( cd " $( dirname " $0 " ) " && pwd) "
55export COMPOSE_PROJECT_NAME=" ${COMPOSE_PROJECT_NAME:- indy-node-monitor-stack} "
6- export APP_NAME=" Indy Node Monitoring Stack"
6+ export APP_NAME=" Indy Node Monitoring Stack"
77set -e
88
99# =================================================================================================================
@@ -16,34 +16,35 @@ Usage:
1616 $0 [options] [command] [args]
1717
1818Commands:
19- up|start [service] - Spin up the ${APP_NAME} environment.
20- Optionally specify the service to spin up (dependencies will also be spun up).
21- down|stop [service] - Tear down the ${APP_NAME} environment.
22- Optionally specify the service to tear down.
23- restart [service] - Restart the ${APP_NAME} environment.
24- Optionally specify the service to restart.
25- list-services - Get a list the services that make up the ${APP_NAME} .
26- logs <service> - Stream the logs from a given container.
27- shell <service> - Open a shell on a given container.
28- install-plugin - Install a Grafana plug-in on the Grafana container.
29- You must restart the ${APP_NAME} environment for it to be loaded.
30-
31- delete-data [service] - Delete the data for a given service, or all services by default.
32- Useful to clear data from Prometheus and/or InfluxDB when making changes to how the data is collected.
33- clean - Cleans up all environment resources.
34- Deletes data from all services.
35- Deletes all containers images and prunes any dangling images.
36- influx-cli - Open a shell to the Influx CLI on the influxdb container
37- flux-repl - Open a shell to the Flux REPL on the influxdb container
38- build [service] - Use for troubleshooting builds when making image configuration changes.
39- Builds container images based on the docker-compose configuration.
40- sed-test - Run a 'sed' parsing test on your machine. Helps diagnose issues with the version
41- of 'sed on some machines.
19+ up|start [service] - Spin up the ${APP_NAME} environment.
20+ Optionally specify the service to spin up (dependencies will also be spun up).
21+ down|stop [service] - Tear down the ${APP_NAME} environment.
22+ Optionally specify the service to tear down.
23+ restart [service] - Restart the ${APP_NAME} environment.
24+ Optionally specify the service to restart.
25+ list-services - Get a list the services that make up the ${APP_NAME} .
26+ logs <service> - Stream the logs from a given container.
27+ shell <service> [bash|sh] - Open a shell on a given container.
28+ Optional - Specify bash or sh as the shell; defaults to bash.
29+ install-plugin - Install a Grafana plug-in on the Grafana container.
30+ You must restart the ${APP_NAME} environment for it to be loaded.
31+
32+ delete-data [service] - Delete the data for a given service, or all services by default.
33+ Useful to clear data from Prometheus and/or InfluxDB when making changes to how the data is collected.
34+ clean - Cleans up all environment resources.
35+ Deletes data from all services.
36+ Deletes all containers images and prunes any dangling images.
37+ influx-cli - Open a shell to the Influx CLI on the influxdb container
38+ flux-repl - Open a shell to the Flux REPL on the influxdb container
39+ build [service] - Use for troubleshooting builds when making image configuration changes.
40+ Builds container images based on the docker-compose configuration.
41+ sed-test - Run a 'sed' parsing test on your machine. Helps diagnose issues with the version
42+ of 'sed on some machines.
4243
4344Options:
44- -h - Print this help documentation.
45- --nightly - Build/Use 'nightly' Influx images, 'latest' images are built/used by default.
46- Works with the up|start and restart commands.
45+ -h - Print this help documentation.
46+ --nightly - Build/Use 'nightly' Influx images, 'latest' images are built/used by default.
47+ Works with the up|start and restart commands.
4748EOF
4849 exit 1
4950}
@@ -173,9 +174,11 @@ function logs() {
173174
174175function openShell() {
175176 (
176- if [ ! -z " ${@ } " ] && isService ${@ } ; then
177- echoBlue " Connecting remote shell to ${@ } (type 'exit' to exit) ..."
178- ${DOCKER_COMPOSE_EXE} exec ${@ } /bin/bash
177+ service=${1}
178+ shellCmd=${2:- bash}
179+ if [ ! -z " ${service} " ] && isService ${service} ; then
180+ echoBlue " Connecting remote shell to ${service} (type 'exit' to exit) ..."
181+ ${DOCKER_COMPOSE_EXE} exec ${service} ${shellCmd}
179182 fi
180183 )
181184}
@@ -404,9 +407,9 @@ function sedTest(){
404407 cat << -EOF > ${sedTestFile}
405408# ===========================================================
406409# This is a file to test parsing with 'sed' on your machine.
407- # - All of the blank lines, comments, and leading and
408- # trailing whitespace should be stripped out of this
409- # file and you should only be left with the
410+ # - All of the blank lines, comments, and leading and
411+ # trailing whitespace should be stripped out of this
412+ # file and you should only be left with the
410413# test phrase wrapped in single quotes:
411414#
412415# '${testPhrase} '
449452 echoBlue " -----------------------------------------------------------------------------------------------------------------------------------------------------------------"
450453 cat << -EOF
451454These scripts use 'sed' and regular expression processing. The default version of 'sed' on MAC does support some of the processing.
452- Details can be found here;
455+ Details can be found here;
453456[Differences between sed on Mac OSX and other "standard" sed?](https://unix.stackexchange.com/questions/13711/differences-between-sed-on-mac-osx-and-other-standard-sed)
454457
455458Please install 'gnu-sed'.
@@ -465,7 +468,7 @@ Append this line to your '~\.bashrc' file:
465468[[ ":\$ PATH:" != *"/usr/local/opt/gnu-sed/libexec/gnubin:"* ]] && export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:\$ PATH"
466469'''
467470
468- Also make sure 'usr/local/bin' is at a higher priority on your **PATH** than 'usr/bin'. You can do this by making sure 'usr/local/bin' is to the left of 'usr/bin',
471+ Also make sure 'usr/local/bin' is at a higher priority on your **PATH** than 'usr/bin'. You can do this by making sure 'usr/local/bin' is to the left of 'usr/bin',
469472preceding it in the **PATH** string. This will ensure that packages installed by Homebrew override system binaries; in this case 'sed'.
470473Append this line to your '~\.bashrc' file:
471474'''
0 commit comments