Hi,
version calculation can be difficult, so I suggest to remove the dots on the version strings so you can compare the numbers with each other. If you already have the local version in a variable, here’s how you can get the version from the latest
Link:
$ curl -sI https://latest.mattermost.com/mattermost-team-linux | sed -n 's!^Location.*/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/mattermost-.*!\1\2\3!p'
720
With this format, you could then just compare the numbers to know if you need to download and update the software.
If you’re using the Enterprise edition, there will be Debian packages soon, so it then boils down to apt update && apt install mattermost
, if you like.