Skip to content

Commit 3ed0875

Browse files
committed
1 parent 04c4782 commit 3ed0875

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spk/radarr/src/service-setup.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ service_postinst ()
3232
mv ${SYNOPKG_PKGDEST}/app/config.xml ${CONFIG_DIR}/Radarr/config.xml
3333
set_unix_permissions "${CONFIG_DIR}"
3434

35-
# If nessecary, add user also to the old group before removing it
35+
# If necessary, add user also to the old group before removing it
3636
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "${LEGACY_GROUP}"
3737
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "users"
3838

@@ -61,7 +61,8 @@ service_preupgrade ()
6161
echo "Installed Radarr Binary: ${CUR_VER}" >> ${INST_LOG}
6262
SPK_VER=$(${MONO_PATH}/monodis --assembly ${SPK_RADARR} | grep "Version:" | awk '{print $2}')
6363
echo "Requested Radarr Binary: ${SPK_VER}" >> ${INST_LOG}
64-
if [ "${CUR_VER//.}" -ge "${SPK_VER//.}" ]; then
64+
function version_compare() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
65+
if version_compare $CUR_VER $SPK_VER; then
6566
echo 'KEEP_CUR="yes"' > ${CONFIG_DIR}/KEEP_VAR
6667
echo "[KEEPING] Installed Radarr Binary - Upgrading Package Only" >> ${INST_LOG}
6768
mv ${SYNOPKG_PKGDEST}/share ${INST_VAR}
@@ -81,6 +82,7 @@ service_postupgrade ()
8182
mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> $INST_LOG 2>&1
8283
set_unix_permissions "${SYNOPKG_PKGDEST}/share"
8384
fi
85+
8486
set_unix_permissions "${CONFIG_DIR}"
8587

8688
# If backup was created before new-style packages

0 commit comments

Comments
 (0)