File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,19 @@ motd_ssh
9494customize
9595
9696msg_info " Retrieving Default Login (Patience)"
97+ PASSWORD_FOUND=0
9798for i in {1..60}; do
98- PASSWORD_LINE=$( docker logs " $CONTAINER_ID " 2>&1 | awk ' / Creating a new user:/ {print; exit} ' )
99+ PASSWORD_LINE=$( docker logs " $CONTAINER_ID " 2>&1 | grep -m1 " Creating a new user:" )
99100 if [[ -n " $PASSWORD_LINE " ]]; then
100101 PASSWORD=$( echo " $PASSWORD_LINE " | awk -F ' password: ' ' {print $2}' )
101102 echo -e
" username: [email protected] \npassword: $PASSWORD " > /opt/.npm_pwd
102103 msg_ok " Saved default login to /opt/.npm_pwd"
104+ PASSWORD_FOUND=1
105+ break
103106 fi
104107 sleep 2
105108done
109+
110+ if [[ $PASSWORD_FOUND -eq 0 ]]; then
111+ msg_ok " No default login found, use docker ps & docker logs for container password."
112+ fi
You can’t perform that action at this time.
0 commit comments