teleo-infrastructure/deploy/install-auto-deploy-sudoers.sh
twentyOne2x 9f6961947b
Some checks are pending
CI / lint-and-test (push) Waiting to run
Fix leoclean auto-deploy restart sudoers
2026-07-10 02:19:30 +02:00

16 lines
422 B
Bash
Executable file

#!/usr/bin/env bash
# Install the narrow sudoers rule required by teleo-auto-deploy.service.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SOURCE="$REPO_ROOT/deploy/sudoers/teleo-auto-deploy"
TARGET="/etc/sudoers.d/teleo-auto-deploy"
if [ "$(id -u)" -ne 0 ]; then
echo "ERROR: run as root on the VPS" >&2
exit 1
fi
install -m 0440 "$SOURCE" "$TARGET"
visudo -cf "$TARGET"
echo "Installed $TARGET"