Skip to content

Commit e10574e

Browse files
authored
Update npmplus-install.sh
1 parent 57b5852 commit e10574e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

install/npmplus-install.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,19 @@ motd_ssh
9494
customize
9595

9696
msg_info "Retrieving Default Login (Patience)"
97+
PASSWORD_FOUND=0
9798
for 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
105108
done
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

0 commit comments

Comments
 (0)