Fix install log parsing (#7140)

This commit is contained in:
Slaviša Arežina 2025-08-24 09:32:04 +02:00 committed by GitHub
parent 8daa235a88
commit 66049f400c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@
"type": "warning"
},
{
"text": "Show password: `cat ~/kasm.creds`",
"text": "Show credentials: `cat ~/kasm.creds`",
"type": "info"
}
]

View File

@ -16,22 +16,22 @@ update_os
msg_info "Installing Kasm Workspaces"
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/')
curl -fsSL -o "/opt/kasm_release_${KASM_VERSION}.tar.gz" "https://kasm-static-content.s3.amazonaws.com/kasm_release_${KASM_VERSION}.tar.gz"
cd /opt
tar -xf "kasm_release_${KASM_VERSION}.tar.gz"
chmod +x /opt/kasm_release/install.sh
printf 'y\ny\ny\n4\n' | bash /opt/kasm_release/install.sh > ~/kasm-install.output 2>&1
cat ~/kasm-install.output | grep -A 20 -i "credentials\|login\|password\|admin" | sed '1i Kasm-Workspaces-Credentials' >~/kasm.creds
awk '
/^Kasm UI Login Credentials$/ {capture=1}
capture {print}
/^Service Registration Token$/ {in_token=1}
in_token && /^-+$/ {dash_count++}
in_token && dash_count==2 {exit}
' ~/kasm-install.output > ~/kasm.creds
msg_ok "Installed Kasm Workspaces"
motd_ssh
customize
msg_info "Displaying Kasm Credentials"
cat ~/kasm.creds
msg_ok "Kasm Credentials displayed"
msg_info "Cleaning up"
rm -f /opt/kasm_release_${KASM_VERSION}.tar.gz
rm -f ~/kasm-install.output