#!/usr/bin/env bash # Tracking Ping - 2 second timeout, always returns 'true' so it never breaks the script curl -s -m 2 "https://hits.sh/github.com/diddy-boy/mini-pi-media-server/install.svg" > /dev/null 2>&1 || true set -e # can be downloaded by running # curl -fsSL https://raw.githubusercontent.com/diddy-boy/mini-pi-media-server/main/install.sh | bash # # Or run # # wget -qO- https://raw.githubusercontent.com/diddy-boy/mini-pi-media-server/main/install.sh | bash # Check for supporting files needed for the installer echo "๐Ÿ” Checking for required tools..." echo " You may be prompted for Sudo password. this is normal" for tool in unzip curl; do if ! command -v $tool >/dev/null 2>&1; then echo "๐Ÿ”ง $tool is missing. Installing..." sudo apt-get update && sudo apt-get install -y $tool fi done REPO="diddy-boy/mini-pi-media-server" BRANCH="main" echo "=========================================" echo " Mini Pi Media Server Installer" echo "=========================================" # Create temp working directory TMPDIR=$(mktemp -d) cd "$TMPDIR" echo "๐Ÿ“ฆ Downloading project from GitHub..." curl -fsSL "https://github.com/$REPO/archive/refs/heads/$BRANCH.zip" -o main.zip echo "๐Ÿ“‚ Extracting files..." unzip -q main.zip cd "mini-pi-media-server-$BRANCH" echo "๐Ÿ—œ Extracting setup package..." SETUP_ZIP=$(ls -v mini-pi*.zip | tail -n 1) if [[ -z "$SETUP_ZIP" ]]; then echo "โŒ Could not find mini-pi setup zip file!" echo " Server Down or maintenance being performed" echo " Please try again later " exit 1 fi echo "๐Ÿ—œ Installing Mini Pi Media Server Version ($SETUP_ZIP)" unzip -q "$SETUP_ZIP" echo "๐Ÿ“ Installing to ~/pi-setup" rm -rf ~/pi-setup cp -r pi-setup ~/ cd ~/pi-setup chmod +x ./*.sh echo "๐Ÿš€ Starting installer..." sudo ./mini-pi-setup.sh sudo chmod +x ./*.sh echo "๐Ÿงน Cleaning up..." rm -rf "$TMPDIR" echo "โœ… Installation complete!" echo "Please reboot PC."