|
28 | 28 |
|
29 | 29 |
|
30 | 30 | # The Minecraft Server Manager version, use "msm version" to check yours. |
31 | | -VERSION="0.9.9" |
| 31 | +VERSION="0.9.10" |
32 | 32 |
|
33 | 33 | # Source, if it exists, the msm profile.d script |
34 | 34 | if [ -f "/etc/profile.d/msm.sh" ]; then |
@@ -1101,16 +1101,23 @@ jargroup_getlatest() { |
1101 | 1101 | # This method allows for backwards compatibility with previous releases |
1102 | 1102 | local target="$(as_user "$SETTINGS_USERNAME" "cat $SETTINGS_JAR_STORAGE_PATH/$1/$SETTINGS_JARGROUP_TARGET")" |
1103 | 1103 | if [[ "$target" =~ ^minecraft ]]; then |
1104 | | - if [[ "$target" == "minecraft" ]]; then |
1105 | | - local versions_target="release" |
1106 | | - elif [[ "$target" == "minecraft-snapshot" ]]; then |
| 1104 | + local versions_target="release" |
| 1105 | + if [[ "$target" == "minecraft-snapshot" ]]; then |
1107 | 1106 | local versions_target="snapshot" |
1108 | 1107 | fi |
| 1108 | + |
| 1109 | + # Check if jq is installed on the local computer |
| 1110 | + as_user "$SETTINGS_USERNAME" "which jq > /dev/null" |
| 1111 | + if [[ "$?" != "0" ]]; then |
| 1112 | + echo "jq is required to download server updates. Please ensure it is installed and the path is set correctly." |
| 1113 | + return 1 |
| 1114 | + fi |
| 1115 | + |
1109 | 1116 | printf "Checking minecraft version JSON... " |
1110 | 1117 | local versions_url="https://launchermeta.mojang.com/mc/game/version_manifest.json" |
1111 | 1118 | local versions_file="/tmp/minecraft_versions.json" |
1112 | 1119 | as_user "$SETTINGS_USERNAME" "wget --quiet $wget_opts --no-check-certificate -O '$versions_file' '$versions_url'" |
1113 | | - local latest_package_url=$(as_user "$SETTINGS_USERNAME" "cat $versions_file | jq -r '.versions | sort_by(.releaseTime) | map(select(.type | contains ("\""release"\""))) | last | .url'") |
| 1120 | + local latest_package_url=$(as_user "$SETTINGS_USERNAME" "cat $versions_file | jq -r '.versions | sort_by(.releaseTime) | map(select(.type | contains ("\""$versions_target"\""))) | last | .url'") |
1114 | 1121 | local latest_version=$(as_user "$SETTINGS_USERNAME" "echo ${latest_package_url##*/} | sed s/.json//") |
1115 | 1122 |
|
1116 | 1123 | if [[ -n "$latest_package_url" ]]; then |
|
0 commit comments