Files
akyldash/infra/bootstrap/verify-helper.sh
agent 02cf4e6e95
CI / tests-and-images (pull_request) Has been cancelled
Expose drift verifier through a fixed sudo helper
2026-10-11 19:39:02 +03:00

15 lines
549 B
Bash

#!/usr/bin/env bash
set -euo pipefail
checkout=/opt/akyldash/current
if [[ $# -ne 0 || $EUID -ne 0 || ! -d $checkout || -L $checkout || $(stat -c %U "$checkout") != root ]]; then
echo 'Refusing verification: the approved root-owned checkout is unavailable.' >&2
exit 1
fi
unsafe=$(find "$checkout" -xdev \( ! -user root -o -perm /022 \) -print -quit)
if [[ -n $unsafe ]]; then
echo 'Refusing verification: the checkout contains a writable or non-root-owned path.' >&2
exit 1
fi
exec /bin/bash "$checkout/infra/bootstrap/verify.sh" --remote