Files
probo/cmd/probo-agent/installer/macos/reinstall.sh
Ludovic Vielle 570395c4ac Add opt-in shell lint and format targets
Introduce make lint-shell / fmt-shell with shellcheck and
shfmt (-i 2 -ci -bn), normalize first-party scripts, and
document the new targets. Keep them out of make lint / fmt.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-07-28 17:37:34 +02:00

27 lines
637 B
Bash
Executable File

#!/bin/bash
#
# Tear down any previous macOS install, then install a signed .pkg.
# Must run as root. Used by: make -C cmd/probo-agent install
#
# Usage: reinstall.sh /path/to/probo-agent_*.pkg
set -eu
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PKG="${1:-}"
if [ "$(id -u)" -ne 0 ]; then
echo "error: must run as root (try: sudo make -C cmd/probo-agent install)" >&2
exit 1
fi
if [ -z "${PKG}" ] || [ ! -f "${PKG}" ]; then
echo "error: usage: $0 /path/to/probo-agent_*.pkg" >&2
exit 2
fi
"${SCRIPT_DIR}/uninstall.sh"
echo "Installing ${PKG}"
installer -pkg "${PKG}" -target /
echo "PKG install complete."