diff --git a/tool/setup_ci_runner.sh b/tool/setup_ci_runner.sh index 0d629ec..8ba3abb 100755 --- a/tool/setup_ci_runner.sh +++ b/tool/setup_ci_runner.sh @@ -168,15 +168,22 @@ fi # ── Config ───────────────────────────────────────────────────────────────── say "Config" CONFIG="$RUNNER_HOME/config.yaml" -if [[ -f "$CONFIG" ]]; then - echo " $CONFIG exists, leaving it alone" +if [[ -f "$CONFIG" && -f "$RUNNER_HOME/.runner" ]]; then + # Registered: this config is in use, do not touch it. + echo " $CONFIG exists and the runner is registered — leaving it alone" else + if [[ -f "$CONFIG" ]]; then + echo " $CONFIG exists but nothing is registered yet — rewriting it" + fi cat > "$CONFIG" <&2