Skip to content

Instantly share code, notes, and snippets.

@marvinmartian
Last active June 21, 2022 16:24
Show Gist options
  • Save marvinmartian/99ef6918d67ebf88ee0e83e6bd13b311 to your computer and use it in GitHub Desktop.
Save marvinmartian/99ef6918d67ebf88ee0e83e6bd13b311 to your computer and use it in GitHub Desktop.
Update Minio Shell Script for Raspberry Pi
#!/bin/sh
MINIO_RELEASE_URL=https://api.github.com/repos/minio/minio/releases
echo "Current Minio Version:"
MINIO_INSTALLED_VERSION=$(/usr/local/bin/minio --version | head -n 1 | sed 's/minio version //' | sed 's/ .*//')
echo $MINIO_INSTALLED_VERSION
echo "Latest Remote Version:"
MINIO_REMOTE_VERSION=$(curl -s $MINIO_RELEASE_URL | python3 -c 'import sys, json; print(json.load(sys.stdin
)[0]["tag_name"])')
echo $MINIO_REMOTE_VERSION
if [ "$MINIO_INSTALLED_VERSION" != "$MINIO_REMOTE_VERSION" ]; then
wget -q https://dl.min.io/server/minio/release/linux-arm64/minio
chmod +x minio
sudo mv minio /usr/local/bin/
sudo systemctl restart minio.service
echo "New Minio Version:"
/usr/local/bin/minio --version
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment