#!/bin/sh # BucketPilot Drop for Linux — one-line installer. # # curl -fsSL https://packages.bucketpilot.io/install.sh | sudo sh # the desktop app # curl -fsSL https://packages.bucketpilot.io/install.sh | sudo sh -s -- --server # the program for servers (no desktop, no Node) # # What it does: adds BucketPilot's SIGNED package repository to this machine (apt on Debian/Ubuntu, dnf on Fedora/RHEL/Rocky/Alma) after checking the signing # key's fingerprint, then installs the package. Updates arrive with the system's own updates. Running it again upgrades. Nothing else on the machine is changed. set -eu BASE="${BUCKETPILOT_PACKAGES_URL:-https://packages.bucketpilot.io}" BASE="${BASE%/}" FPR="7BD2864133181DC87FF45B928C4999F0BFDD52BB" PKG="bucketpilot-drop" say() { printf '%s\n' "$*"; } die() { printf 'bucketpilot installer: %s\n' "$*" >&2; exit 1; } while [ $# -gt 0 ]; do case "$1" in --server) PKG="bucketpilot-drop-server" ;; --desktop) PKG="bucketpilot-drop" ;; -h|--help) say "Usage: curl -fsSL $BASE/install.sh | sudo sh -s -- [--server | --desktop]"; exit 0 ;; *) die "unknown option $1 (use --server for the server program, --desktop for the desktop app)" ;; esac shift done [ "$(uname -s)" = "Linux" ] || die "this installer is for Linux. On macOS and Windows, ask BucketPilot for the installer." [ "$(id -u)" -eq 0 ] || die "it needs root to add a package repository. Run: curl -fsSL $BASE/install.sh | sudo sh" case "$(uname -m)" in x86_64|amd64|aarch64|arm64) ;; *) die "BucketPilot Drop is built for x86-64 and arm64; this machine is $(uname -m)." ;; esac ID=""; ID_LIKE=""; [ -r /etc/os-release ] && . /etc/os-release FAMILY="" for w in $ID $ID_LIKE; do case "$w" in debian|ubuntu) FAMILY=apt ;; fedora|rhel|centos|rocky|almalinux|ol) FAMILY=rpm ;; esac [ -n "$FAMILY" ] && break done [ -n "$FAMILY" ] || die "this distribution (${PRETTY_NAME:-unknown}) is not Debian/Ubuntu or Fedora/RHEL based. Download the program from the installers page instead, or ask BucketPilot." say "BucketPilot Drop — installing $PKG on ${PRETTY_NAME:-Linux} ($(uname -m))" fetch() { # url, destination if command -v curl >/dev/null 2>&1; then curl -fsSL "$1" -o "$2" elif command -v wget >/dev/null 2>&1; then wget -q -O "$2" "$1" else die "needs curl or wget"; fi } TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT if [ "$FAMILY" = apt ]; then export DEBIAN_FRONTEND=noninteractive # gpg only to CHECK the key's fingerprint; ca-certificates for https. NEED="" command -v gpg >/dev/null 2>&1 || NEED="$NEED gpg" [ -d /etc/ssl/certs ] && [ -n "$(ls /etc/ssl/certs 2>/dev/null)" ] || NEED="$NEED ca-certificates" command -v curl >/dev/null 2>&1 || command -v wget >/dev/null 2>&1 || NEED="$NEED curl" if [ -n "$NEED" ]; then apt-get update -qq && apt-get install -y -qq $NEED; fi fetch "$BASE/bucketpilot.gpg" "$TMP/key.gpg" || die "could not download the signing key from $BASE" GOT="$(gpg --show-keys --with-colons "$TMP/key.gpg" 2>/dev/null | awk -F: '/^fpr/ {print $10; exit}')" [ "$GOT" = "$FPR" ] || die "the signing key's fingerprint is $GOT, not the expected $FPR. Nothing was installed." install -d -m 755 /usr/share/keyrings install -m 644 "$TMP/key.gpg" /usr/share/keyrings/bucketpilot.gpg echo "deb [signed-by=/usr/share/keyrings/bucketpilot.gpg] $BASE/apt stable main" > /etc/apt/sources.list.d/bucketpilot.list apt-get update -qq || die "apt update failed" apt-get install -y "$PKG" else PM=dnf; command -v dnf >/dev/null 2>&1 || PM=yum command -v curl >/dev/null 2>&1 || command -v wget >/dev/null 2>&1 || "$PM" install -y curl fetch "$BASE/bucketpilot.repo" "$TMP/bucketpilot.repo" || die "could not download the repository file from $BASE" grep -q '^gpgcheck=1' "$TMP/bucketpilot.repo" && grep -q '^repo_gpgcheck=1' "$TMP/bucketpilot.repo" || die "the repository file does not turn on signature checks. Nothing was installed." install -m 644 "$TMP/bucketpilot.repo" /etc/yum.repos.d/bucketpilot.repo "$PM" install -y "$PKG" "$PM" upgrade -y "$PKG" >/dev/null 2>&1 || true fi say "" say "Installed: $PKG" if [ "$PKG" = "bucketpilot-drop-server" ]; then say "Next: bucketpilot-drop login (opens a code to approve in your browser)" say " bucketpilot-drop connect (starts the service that uploads what you put in the drop folder)" else say "Start it from your applications menu (BucketPilot Drop), or run: bucketpilot-drop-desktop" fi say "Updates arrive with your normal system updates. Log of what it uploads: /var/log/BucketPilot/drop.log (server) or the app's tray menu → Show log."