Skip to content

Conversation

@Ploratio
Copy link

@Ploratio Ploratio commented Apr 17, 2021

I slightly changed the IF block.
It is comparing full version names with different hashes for same version in the current state of the script.
For example:

New Ver: 1.22.2.4282-a97b03fad
Cur Ver: 1.22.2.4282-6000

I cut the suffix from the version, so only the part before the first dash is taken into the account in the IF. In the example above it would parse both new and current versions to 1.22.2.4282
I'm only using the shorter versions to decide if upgrading is necessary, so you can still see the full version in logs.

I slightly changed the if block.
It is comparing full version names with different hashes for same version in the current state of the script.
For example:
New Ver: 1.2.2.4282-a97b03fad
Cur Ver: 1.22.2.4282-6000

I cut the suffix from the version, so only the part before the first dash is taken into the account in the IF. In the example above it would parse both new and current versions to "1.22.2.4282".
I'm only using the shorter versions to decide if upgrading is necessary, so you can still see the full version in logs.
@vmonkey
Copy link

vmonkey commented May 27, 2021

Another option is to get the right version number, e.g., by
serverIP=$(ip -o route get to 1.2.3.4 | sed -n 's/.*src \([0-9.]\+\).*/\1/p')
curversion=$(curl -s "http://$serverIP:32400/?X-Plex-Token=$token" | grep -oP "(?<=<MediaContainer)[^>]+" | grep -oP 'version="\K[^"]+')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants