#!/usr/bin/env sh # Installs the tsunagi binary and, where systemd is present, a root service. # Run it as root (it writes under /usr/local and /etc): # # sudo ./install.sh # # PREFIX overrides the install prefix (default /usr/local). set -eu PREFIX="${PREFIX:-/usr/local}" here="$(cd "$(dirname "$0")" && pwd)" if [ "$(id -u)" -ne 0 ]; then echo "This installer writes to ${PREFIX}/bin and /etc; re-run it as root (sudo)." >&2 exit 1 fi echo "Installing tsunagi to ${PREFIX}/bin" install -d "${PREFIX}/bin" install -m 0755 "${here}/tsunagi" "${PREFIX}/bin/tsunagi" if command -v systemctl >/dev/null 2>&1; then echo "Installing the systemd service (runs the agent as root)" install -m 0644 "${here}/tsunagi.service" /etc/systemd/system/tsunagi.service systemctl daemon-reload cat < EOF else cat <