Skip to content

Commit 66049f4

Browse files
authored
Fix install log parsing (#7140)
1 parent 8daa235 commit 66049f4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

frontend/public/json/kasm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"type": "warning"
4242
},
4343
{
44-
"text": "Show password: `cat ~/kasm.creds`",
44+
"text": "Show credentials: `cat ~/kasm.creds`",
4545
"type": "info"
4646
}
4747
]

install/kasm-install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ update_os
1616
msg_info "Installing Kasm Workspaces"
1717
KASM_VERSION=$(curl -fsSL 'https://www.kasmweb.com/downloads' | grep -o 'https://kasm-static-content.s3.amazonaws.com/kasm_release_[^"]*\.tar\.gz' | head -n 1 | sed -E 's/.*release_(.*)\.tar\.gz/\1/')
1818
curl -fsSL -o "/opt/kasm_release_${KASM_VERSION}.tar.gz" "https://kasm-static-content.s3.amazonaws.com/kasm_release_${KASM_VERSION}.tar.gz"
19-
2019
cd /opt
2120
tar -xf "kasm_release_${KASM_VERSION}.tar.gz"
2221
chmod +x /opt/kasm_release/install.sh
2322
printf 'y\ny\ny\n4\n' | bash /opt/kasm_release/install.sh > ~/kasm-install.output 2>&1
24-
cat ~/kasm-install.output | grep -A 20 -i "credentials\|login\|password\|admin" | sed '1i Kasm-Workspaces-Credentials' >~/kasm.creds
25-
23+
awk '
24+
/^Kasm UI Login Credentials$/ {capture=1}
25+
capture {print}
26+
/^Service Registration Token$/ {in_token=1}
27+
in_token && /^-+$/ {dash_count++}
28+
in_token && dash_count==2 {exit}
29+
' ~/kasm-install.output > ~/kasm.creds
2630
msg_ok "Installed Kasm Workspaces"
2731

2832
motd_ssh
2933
customize
3034

31-
msg_info "Displaying Kasm Credentials"
32-
cat ~/kasm.creds
33-
msg_ok "Kasm Credentials displayed"
34-
3535
msg_info "Cleaning up"
3636
rm -f /opt/kasm_release_${KASM_VERSION}.tar.gz
3737
rm -f ~/kasm-install.output

0 commit comments

Comments
 (0)