From 08dc06b2c6a5eb701d92a2ae3e8f5fe441112147 Mon Sep 17 00:00:00 2001 From: jash Date: Sun, 21 Oct 2018 10:03:47 +0200 Subject: [PATCH] recreate mode using password from env does not need tty --- dist/setup.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dist/setup.sh b/dist/setup.sh index 5415707..1ee0b0f 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -127,23 +127,29 @@ configure() { - ARCH=$(uname -m) + local arch=$(uname -m) + local pw_env='' + local interactive=' -it' - if [[ $ARCH =~ ^arm ]]; then + if [[ $CFG_PASSWORD ]]; then + pw_env=" -e CFG_PASSWORD=$CFG_PASSWORD" + if [[ ''$recreate == 'recreate' ]]; then + logline 'Non interactive mode...' + interactive='' + fi + fi + + + if [[ $arch =~ ^arm ]]; then clear && echo "Thinking. This may take a while, since I'm a Raspberry PI and my brain is so small. :D" else clear && echo "Thinking..." fi - PW_ENV='' - if [[ $CFG_PASSWORD ]]; then - PW_ENV=" -e CFG_PASSWORD=$CFG_PASSWORD" - fi - # configure features of cyphernode docker run -v $current_path:/data \ - --log-driver=none$PW_ENV \ - --rm -it cyphernodeconf:latest $(id -u):$(id -g) yo --no-insight cyphernode $recreate + --log-driver=none$pw_env \ + --rm$interactive cyphernodeconf:latest $(id -u):$(id -g) yo --no-insight cyphernode $recreate } copy_file() {