]> ###2026.05.30 - First-run setup wizard: auto-detects hostname, creates master.conf + host conf from templates - Scheduler setup mode: after wizard, master.conf and host conf open sequentially with forced save flow - Partnership tab: Onboard button highlighted on arrival from wizard; disabled until partner is configured - HOST2 install paths: state-file pull, master.conf push detection, conf-only flow - Onboard Step 9: master.conf automatically pushed to all listed hosts on onboard completion - Graceful pre-onboard state: neutral banners instead of error warnings before SSH is configured - GitHub link in tab bar and Settings page; Community Apps support URL ###2026.05.28 - Initial release: Monitor, Scheduler, Docker, Watchdog, Partnership, Fallback, Arrs tabs - Mutual container fallback with tiered escalation and strike-confirmed handback - Partnership lifecycle: onboard, offboard, transfer - Rsync profile system with per-share container stops and writeback - Watchdog: Tier 1 (explicit) + Tier 2 (global scan) container monitoring - master.conf push-on-save to all configured partners via SSH /dev/null) [[ -n "$_sd" ]] && SCRIPTS_DIR="$_sd" fi SCRIPTS_DIR="${SCRIPTS_DIR:-/mnt/user/appdata/Varaverk}" CONF_DIR="$SCRIPTS_DIR/Configurations" # Array must be started — appdata must be available if ! df --output=fstype /mnt/user 2>/dev/null | grep -q 'shfs'; then log "Array not started — cannot install to appdata" log "Start the array then reinstall, or wait for next boot" exit 0 fi # Clone or update repo if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then log "Cloning $GITHUB ($BRANCH) → $SCRIPTS_DIR" if ! git clone --branch "$BRANCH" "$GITHUB" "$SCRIPTS_DIR" >> "$LOG" 2>&1; then log "ERROR: git clone failed — check internet access and GitHub URL" exit 1 fi log "Clone complete" else log "Updating repo in $SCRIPTS_DIR" git -C "$SCRIPTS_DIR" pull --ff-only origin "$BRANCH" >> "$LOG" 2>&1 \ && log "Pull complete" \ || log "WARNING: git pull failed — repo may have local modifications" fi # Sanity check — Plugin/unraid must exist after clone if [[ ! -d "$SCRIPTS_DIR/Plugin/unraid" ]]; then log "ERROR: Plugin/unraid not found in cloned repo — unexpected repo structure" exit 1 fi # Symlink web files if [[ -L "$WEB_DIR" ]]; then rm "$WEB_DIR" elif [[ -d "$WEB_DIR" ]]; then log "WARNING: $WEB_DIR is a real directory — not replacing (remove manually if needed)" fi if [[ ! -e "$WEB_DIR" ]]; then ln -s "$SCRIPTS_DIR/Plugin/unraid" "$WEB_DIR" log "Symlinked: $WEB_DIR → $SCRIPTS_DIR/Plugin/unraid" fi # Write varaverk.cfg if not present if [[ ! -f "$CFG_FILE" ]]; then printf 'SCRIPTS_DIR="%s"\n' "$SCRIPTS_DIR" > "$CFG_FILE" log "Created varaverk.cfg (SCRIPTS_DIR=$SCRIPTS_DIR)" fi # Create Configurations dir if git clone didn't mkdir -p "$CONF_DIR" # Bootstrap master.conf from template on first install if [[ ! -f "$CONF_DIR/master.conf" ]]; then if [[ -f "$SCRIPTS_DIR/Configurations/master.conf.template" ]]; then cp "$SCRIPTS_DIR/Configurations/master.conf.template" "$CONF_DIR/master.conf" log "Created master.conf from template — fill in HOST1 and HOST2 to continue" else log "WARNING: master.conf.template not found — master.conf not created" fi fi log "Install complete — open Varaverk in Unraid to complete setup" log "→ Plugins → Varaverk (or navigate to Settings → Utilities → Varaverk)" ]]> /dev/null) fi SCRIPTS_DIR="${_sd:-/mnt/user/appdata/Varaverk}" # Only act if source exists (array started) and symlink is missing if [[ -d "$SCRIPTS_DIR/Plugin/unraid" ]] && [[ ! -e "$WEB_DIR" ]]; then [[ -L "$WEB_DIR" ]] && rm "$WEB_DIR" ln -s "$SCRIPTS_DIR/Plugin/unraid" "$WEB_DIR" fi ]]> /dev/null) fi SCRIPTS_DIR="${_sd:-/mnt/user/appdata/Varaverk}" # ── Stop continuous background scripts ─────────────────────────────────────── # fallback.sh manages its own lock — use --stop for clean shutdown if [[ -f "$SCRIPTS_DIR/Fallback/fallback.sh" ]]; then bash "$SCRIPTS_DIR/Fallback/fallback.sh" --stop 2>/dev/null && \ log "fallback.sh stopped" || true fi # Kill any remaining Varaverk background processes (watchdog orchestrator, etc.) pkill -f "run_job.sh" 2>/dev/null || true pkill -f "watchdog_orchestrator.sh" 2>/dev/null || true # ── Remove cron entries ─────────────────────────────────────────────────────── if [[ -f "$CRON_FILE" ]]; then rm -f "$CRON_FILE" /usr/local/sbin/update_cron 2>/dev/null || true log "Cron entries removed" fi # Remove legacy direct cron file if it exists rm -f /etc/cron.d/varaverk # ── Remove web symlink ──────────────────────────────────────────────────────── [[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR" && log "Web symlink removed" # ── Remove plugin config from flash ────────────────────────────────────────── rm -rf "$CFG_DIR" log "Plugin config removed from flash" log "Done. Scripts and conf in $SCRIPTS_DIR are preserved." log "To fully remove: delete $SCRIPTS_DIR manually." ]]>