diff --git a/LinuxGeneralCompiler/dlvs.sh b/LinuxGeneralCompiler/dlvs.sh index 028d684..b48a1bc 100644 --- a/LinuxGeneralCompiler/dlvs.sh +++ b/LinuxGeneralCompiler/dlvs.sh @@ -10,7 +10,7 @@ download_game() { if [[ $version == *"-"* ]]; then url="https://cdn.vintagestory.at/gamefiles/unstable/vs_server_linux-x64_${version}.tar.gz" else - url="https://cdn.virtualstory.at/gamefiles/stable/vs_server_linux-x64_${version}.tar.gz" + url="https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_${version}.tar.gz" fi # Check if extract path already exists and is not empty @@ -26,8 +26,18 @@ download_game() { # Extract and clean up mkdir -pv $extract_path cd $extract_path - tar -xvf "${download_path}.tar.gz" && rm "${download_path}"/"${version}"*.tar.gz - cd / + tar -xvf "${download_path}.tar.gz" && rm "${download_path}.tar.gz" + + if [ $? -eq 0 ] + then + cd / + echo "Successfully downloaded and extracted $version to $extract_path" + else + rm -rf "$download_path" + rm -rf "$extract_path" + echo "Game version was not found. Something went wrong. Cleaning up artifacts..." + cd / + fi } # Call the function with version as argument (e.g. "1.20.12")