#!/bin/sh # Installs spool on this Linux computer as a service that starts with it: # the print queue, the printers on this network and the slicing, with no # screen and no one signed in. Run it again to update. # # curl -fsSL https://spool.spencerhubert.info/install.sh | sudo sh set -eu site=https://spool.spencerhubert.info if [ "$(uname -s)" != Linux ]; then echo "This installs spool on Linux. On a Mac or Windows, download the app from $site" >&2 exit 1 fi if [ "$(id -u)" != 0 ]; then echo "Run it with sudo: curl -fsSL $site/install.sh | sudo sh" >&2 exit 1 fi if ! command -v systemctl >/dev/null 2>&1; then echo "spool's service needs systemd, which this computer does not have." >&2 exit 1 fi case "$(uname -m)" in x86_64 | amd64) arch=amd64 ;; aarch64 | arm64) arch=arm64 ;; *) echo "There is no spool for $(uname -m) yet." >&2 exit 1 ;; esac tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT echo "Downloading spool for Linux ($arch)..." curl -fsSL -o "$tmp/spool" "$site/updates/spool-linux-$arch" chmod 0755 "$tmp/spool" "$tmp/spool" service install