@@ -13,12 +13,26 @@ setting_up_container
1313network_check
1414update_os
1515
16- 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/' )
16+ msg_info " Detecting latest Kasm Workspaces release"
17+ KASM_URL=$(
18+ curl -fsSL " https://www.kasm.com/downloads" \
19+ | tr ' \n' ' ' \
20+ | grep -oE ' https://kasm-static-content[^"]*kasm_release_[0-9]+\.[0-9]+\.[0-9]+\.[a-z0-9]+\.tar\.gz' \
21+ | head -n 1
22+ )
23+
24+ if [[ -z " $KASM_URL " ]]; then
25+ msg_error " Unable to detect latest Kasm release URL."
26+ exit 1
27+ fi
28+
29+ KASM_VERSION=$( echo " $KASM_URL " | sed -E ' s/.*kasm_release_([0-9]+\.[0-9]+\.[0-9]+).*/\1/' )
30+ msg_ok " Detected Kasm Workspaces version $KASM_VERSION "
1731
1832msg_warn " WARNING: This script will run an external installer from a third-party source (https://www.kasmweb.com/)."
1933msg_warn " The following code is NOT maintained or audited by our repository."
2034msg_warn " If you have any doubts or concerns, please review the installer code before proceeding:"
21- msg_custom " ${TAB3}${GATEWAY}${BGN}${CL} " " \e[1;34m" " → install.sh inside tar.gz https://kasm-static-content.s3.amazonaws.com/kasm_release_ ${KASM_VERSION} .tar.gz "
35+ msg_custom " ${TAB3}${GATEWAY}${BGN}${CL} " " \e[1;34m" " → install.sh inside tar.gz $KASM_URL "
2236echo
2337read -r -p " ${TAB3} Do you want to continue? [y/N]: " CONFIRM
2438if [[ ! " $CONFIRM " =~ ^([yY][eE][sS]| [yY])$ ]]; then
@@ -27,7 +41,7 @@ if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
2741fi
2842
2943msg_info " Installing Kasm Workspaces"
30- curl -fsSL -o " /opt/kasm_release_${KASM_VERSION} .tar.gz" " https://kasm-static-content.s3.amazonaws.com/kasm_release_ ${KASM_VERSION} .tar.gz "
44+ curl -fsSL -o " /opt/kasm_release_${KASM_VERSION} .tar.gz" " $KASM_URL "
3145cd /opt
3246tar -xf " kasm_release_${KASM_VERSION} .tar.gz"
3347chmod +x /opt/kasm_release/install.sh
@@ -39,10 +53,10 @@ awk '
3953 in_token && /^-+$/ {dash_count++}
4054 in_token && dash_count==2 {exit}
4155' ~ /kasm-install.output > ~/kasm.creds
56+ rm -f /opt/kasm_release_${KASM_VERSION} .tar.gz
57+ rm -f ~ /kasm-install.output
4258msg_ok " Installed Kasm Workspaces"
4359
4460motd_ssh
4561customize
46- rm -f /opt/kasm_release_${KASM_VERSION} .tar.gz
47- rm -f ~ /kasm-install.output
4862cleanup_lxc
0 commit comments