diff --git a/ct/kasm.sh b/ct/kasm.sh index a1e350caa..9d1be38c8 100644 --- a/ct/kasm.sh +++ b/ct/kasm.sh @@ -35,7 +35,7 @@ function update_script() { CURRENT_VERSION=$(readlink -f /opt/kasm/current | awk -F'/' '{print $4}') KASM_VERSION=$(curl -s https://kasm.com/downloads | grep -oP ']*>.*?' | sed -E 's/<\/?h1[^>]*>//g' | grep -oP '\d+\.\d+\.\d+') KASM_URL="https://kasm-static-content.s3.amazonaws.com/kasm_release_${KASM_VERSION:-var_kasm_version}.tar.gz" - + # KASM_URL=$(curl -fsSL "https://www.kasm.com/downloads" | tr '\n' ' ' | grep -oE 'https://kasm-static-content[^"]*kasm_release_[0-9]+\.[0-9]+\.[0-9]+\.[a-z0-9]+\.tar\.gz' | head -n 1) # if [[ -z "$KASM_URL" ]]; then # SERVICE_IMAGE_URL=$(curl -fsSL "https://www.kasm.com/downloads" | tr '\n' ' ' | grep -oE 'https://kasm-static-content[^"]*kasm_release_service_images_amd64_[0-9]+\.[0-9]+\.[0-9]+\.tar\.gz' | head -n 1) @@ -46,7 +46,7 @@ function update_script() { # else # KASM_VERSION=$(echo "$KASM_URL" | sed -E 's/.*kasm_release_([0-9]+\.[0-9]+\.[0-9]+).*/\1/') # fi - + if [[ -z "$KASM_VERSION" ]] || [[ -z "$KASM_URL" ]]; then msg_error "Unable to detect latest Kasm release URL." exit 250 @@ -56,10 +56,10 @@ function update_script() { msg_info "Removing outdated docker-compose plugin" [ -f ~/.docker/cli-plugins/docker-compose ] && rm -rf ~/.docker/cli-plugins/docker-compose msg_ok "Removed outdated docker-compose plugin" - + if [[ -z "$CURRENT_VERSION" ]] || [[ "$KASM_VERSION" != "$CURRENT_VERSION" ]]; then msg_info "Updating Kasm" - cd /tmp + cd /tmp msg_warn "WARNING: This script will run an external installer from a third-party source (https://www.kasmweb.com/)." msg_warn "The following code is NOT maintained or audited by our repository." @@ -75,13 +75,13 @@ function update_script() { tar -xf "kasm_release_${KASM_VERSION}.tar.gz" chmod +x /tmp/kasm_release/install.sh rm -f /tmp/kasm_release_"${KASM_VERSION}".tar.gz - + bash /tmp/kasm_release/upgrade.sh --proxy-port 443 rm -rf /tmp/kasm_release msg_ok "Updated successfully!" else msg_ok "No update required. Kasm is already at v${KASM_VERSION}" - + fi exit } diff --git a/install/kasm-install.sh b/install/kasm-install.sh index 107fe7ea2..3b9bafa10 100644 --- a/install/kasm-install.sh +++ b/install/kasm-install.sh @@ -20,7 +20,7 @@ msg_ok "Installed Docker" msg_info "Detecting latest Kasm Workspaces release" KASM_VERSION=$(curl -s https://kasm.com/downloads | grep -oP ']*>.*?' | sed -E 's/<\/?h1[^>]*>//g' | grep -oP '\d+\.\d+\.\d+') KASM_URL="https://kasm-static-content.s3.amazonaws.com/kasm_release_${KASM_VERSION:-var_kasm_version}.tar.gz" - + # KASM_URL=$(curl -fsSL "https://www.kasm.com/downloads" | tr '\n' ' ' | grep -oE 'https://kasm-static-content[^"]*kasm_release_[0-9]+\.[0-9]+\.[0-9]+\.[a-z0-9]+\.tar\.gz' | head -n 1) # if [[ -z "$KASM_URL" ]]; then # SERVICE_IMAGE_URL=$(curl -fsSL "https://www.kasm.com/downloads" | tr '\n' ' ' | grep -oE 'https://kasm-static-content[^"]*kasm_release_service_images_amd64_[0-9]+\.[0-9]+\.[0-9]+\.tar\.gz' | head -n 1) diff --git a/misc/tools.func b/misc/tools.func index ccf81fcd6..2166f703f 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2524,7 +2524,6 @@ check_for_gh_release() { if [[ "$current" =~ ^v[0-9] ]]; then current="${current:1}" fi - # Pinned version handling if [[ -n "$pinned_version_in" ]]; then @@ -2815,9 +2814,9 @@ function curl_download() { while ((attempt <= retries)); do if curl --connect-timeout 15 \ - --speed-limit 1024 \ - --speed-time 60 \ - -fsSL -o "$output" "$url"; then + --speed-limit 1024 \ + --speed-time 60 \ + -fsSL -o "$output" "$url"; then return 0 fi if ((attempt < retries)); then