VERSION=3.6.2
OLDVERSION=$(/home/chat/mattermost/bin/platform version 2>&1 | head -n 1 | awk '{print $2}')
wget https://releases.mattermost.com/$VERSION/mattermost-team-$VERSION-linux-amd64.tar.gz
cd
wget https://releases.mattermost.com/$VERSION/mattermost-team-$VERSION-linux-amd64.tar.gz
mv mattermost mattermost-$OLDVERSION
tar xvf mattermost-team-$VERSION-linux-amd64.tar.gz