Files
simple-object-server/install.sh
Your Name 8ab6028597
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / build (linux/arm64) (push) Failing after 32s
Build-Test-Publish / create-manifest (push) Has been skipped
test: Add 8 and update 14 files
2025-08-10 21:18:40 +12:00

40 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
# Get script directory
#SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
export PROJECT="simple-object-server"
function die() {
echo "error: $1" && exit 1
}
# Set target directory - use ~/.local/bin by default, /usr/local/bin if root
TARGET_DIR="/usr/local/bin"
if [ "$(id -u)" != "0" ]; then
TARGET_DIR="${HOME}/.local/bin"
mkdir -p "${TARGET_DIR}"
fi
command -v wget >/dev/null 2>&1 || die "wget is not installed. Please install wget and try again."
ARCH=$(uname -m)
echo "Downloading simple-object-server..."
wget "https://getbin.xyz/simple-object-server:latest-${ARCH}" -O "${TARGET_DIR}/simple-object-server"
chmod +x "${TARGET_DIR}/simple-object-server"
echo "Downloading sos-hash utility..."
wget "https://getbin.xyz/sos-hash:latest-${ARCH}" -O "${TARGET_DIR}/sos-hash"
chmod +x "${TARGET_DIR}/sos-hash"
echo ""
echo "Installation complete!"
echo " - Server installed to: ${TARGET_DIR}/simple-object-server"
echo " - Hash utility installed to: ${TARGET_DIR}/sos-hash"
echo ""
echo "To generate token hashes for configuration, use:"
echo " sos-hash"