#!/bin/bash set -e OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64) ARCH="arm64" ;; arm64) ARCH="arm64" ;; esac PIDRIVE_SERVER="https://pidrive.ressl.ai" echo "Installing pidrive for $OS/$ARCH..." # Install sshfs (needed for mounting) if ! command -v sshfs &>/dev/null; then echo "Installing sshfs..." if [ "$OS" = "linux" ]; then if command -v apt &>/dev/null; then sudo apt update && sudo apt install -y sshfs elif command -v yum &>/dev/null; then sudo yum install -y fuse-sshfs fi elif [ "$OS" = "darwin" ]; then if ! test -d /Library/Filesystems/macfuse.fs; then echo "macFUSE required. Install from: https://osxfuse.github.io/" exit 1 fi brew tap gromgit/fuse 2>/dev/null brew install gromgit/fuse/sshfs-mac 2>/dev/null || echo "Install sshfs: brew install gromgit/fuse/sshfs-mac" fi fi # Install pidrive CLI echo "Installing pidrive CLI..." curl -sSLo /usr/local/bin/pidrive \ "${PIDRIVE_SERVER}/releases/pidrive-${OS}-${ARCH}" chmod +x /usr/local/bin/pidrive echo "" echo "pidrive installed!" echo "" echo "Next steps:" echo " pidrive register --email you@company.com --name \"My Agent\" --server ${PIDRIVE_SERVER}" echo " pidrive mount" echo " ls /drive/"