Skip to content

Version parsing for upgrade decision #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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