#!/bin/bash set -eu GITEA_URL="${GITEA_URL:-http://192.168.123.100:8418}" REG_TOKEN="${REG_TOKEN:-}" RUNNER_NAME="${RUNNER_NAME:-synology-runner}" RUNNER_LABEL="${RUNNER_LABEL:-snapshot-admin-host}" RUNNER_DIR="${RUNNER_DIR:-/volume1/gitea/act_runner}" ACT_RUNNER_VERSION="${ACT_RUNNER_VERSION:-0.2.11}" if [ -z "$REG_TOKEN" ]; then echo "ERROR: REG_TOKEN is required" echo "usage: REG_TOKEN=... GITEA_URL=... bash tools/re_register_act_runner_synology.sh" exit 1 fi ARCH=$(uname -m) case "$ARCH" in x86_64) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-amd64" ;; aarch64) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-arm64" ;; armv7l) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-arm-7" ;; *) echo "ERROR: 지원하지 않는 아키텍처: $ARCH"; exit 1 ;; esac mkdir -p "$RUNNER_DIR/workspace" if [ ! -x "$RUNNER_DIR/act_runner" ]; then DOWNLOAD_URL="https://gitea.com/gitea/act_runner/releases/download/v${ACT_RUNNER_VERSION}/${BINARY}" echo "[install] $DOWNLOAD_URL" curl -L --progress-bar "$DOWNLOAD_URL" -o "$RUNNER_DIR/act_runner" chmod +x "$RUNNER_DIR/act_runner" fi cat > "$RUNNER_DIR/config.yaml" <