Change Update to use non-POSIX techniques

QNAP BusyBox 'grep' no longer supports POSIX.
Refactor to alternative method
This commit is contained in:
ChuckPa
2025-01-03 19:03:01 -05:00
parent 804c9014d1
commit 48f7ff7f36
2 changed files with 8 additions and 4 deletions

View File

@@ -2,12 +2,12 @@
#########################################################################
# Plex Media Server database check and repair utility script. #
# Maintainer: ChuckPa #
# Version: v1.10.01 #
# Date: 02-Jan-2025 #
# Version: v1.10.02 #
# Date: 03-Jan-2025 #
#########################################################################
# Version for display purposes
Version="v1.10.01"
Version="v1.10.02"
# Have the databases passed integrity checks
CheckedDB=0
@@ -1633,7 +1633,7 @@ DoUpdateTimestamp() {
GetLatestRelease() {
Response=$(curl -s "https://api.github.com/repos/ChuckPa/PlexDBRepair/tags")
if [ $? -eq 0 ]; then
LatestVersion="$(echo "$Response" | grep -oP '"name":\s*"\K[^"]*' | sed -n '1p')"
LatestVersion="$(echo "$Response" | awk -F : '{print $2}' | awk -F \, '{print $1}' | tr -d \")"
else
LatestVersion="$Version"
fi