diff --git a/dist/setup.sh b/dist/setup.sh index 6b55555..c8c9617 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -562,19 +562,33 @@ realpath() { } -sanity_checks() { - - echo " check requirements." - +check_docker() { if ! [ -x "$(command -v docker)" ]; then echo " docker is not installed on your system. Please check https://www.docker.com/get-started." exit fi +} - if [[ $DOCKER_MODE == 'compose' && ! -x "$(command -v docker-compose)" ]]; then +check_docker_compose() { + if ! [ -x "$(command -v docker-compose)" ]; then echo " docker-compose is not installed on your system. Please check https://docs.docker.com/compose/install/." exit fi +} + +sanity_checks_pre_config() { + echo " check requirements for configuration step." + check_docker +} + +sanity_checks_pre_install() { + + echo " check requirements for installation step." + + check_docker + if [[ $DOCKER_MODE == 'compose' ]]; then + check_docker_compose + fi local OS=$(uname -s) @@ -723,6 +737,7 @@ if [[ $CONFIGURE == 0 && $INSTALL == 0 && $RECREATE == 0 ]]; then fi if [[ $CONFIGURE == 1 ]]; then + sanity_checks_pre_config configure $RECREATE fi @@ -737,7 +752,7 @@ if [[ $CLEANUP == 'true' && $(docker image ls | grep cyphernodeconf) =~ cypherno fi if [[ $INSTALL == 1 ]]; then - sanity_checks + sanity_checks_pre_install create_user install modify_owner