# Sourced by the scripts in /scripts (ADR-0171): they run as root on the
# panel server and act through scalpanelctl, as the provider.
set -euo pipefail
SCALPANELCTL=/usr/local/sbin/scalpanelctl
usage() { echo "usage: ${0##*/} $*" >&2; exit 2; }
# -h / --help: the script's own description (its first comment lines).
case "${1:-}" in -h|--help) sed -n '2,/^[^#]/p' "$0" | sed -e '/^[^#]/d' -e 's/^# \{0,1\}//'; exit 0 ;; esac
[ "$(id -u)" = 0 ] || { echo "${0##*/}: run as root" >&2; exit 1; }
admin() { exec "$SCALPANELCTL" admin "$@"; }
