#!/bin/bash # dev_install.sh — symlinks plugin files into unRAID WebUI for local development. # Run once after cloning. Re-run if the plugin directory is moved. # Safe to re-run: removes stale symlink before recreating. set -euo pipefail PLUGIN_NAME="varaverk" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SOURCE="$SCRIPT_DIR/usr/local/emhttp/plugins/$PLUGIN_NAME" TARGET="/usr/local/emhttp/plugins/$PLUGIN_NAME" if [ ! -d "$SOURCE" ]; then echo "ERROR: Source not found: $SOURCE" exit 1 fi if [ -L "$TARGET" ]; then echo "Removing existing symlink: $TARGET" rm "$TARGET" elif [ -d "$TARGET" ]; then echo "ERROR: $TARGET exists as a real directory — remove it manually first." exit 1 fi ln -s "$SOURCE" "$TARGET" echo "Linked: $TARGET -> $SOURCE" echo "" echo "Plugin available in unRAID WebUI under Utilities → Varaverk." echo "Changes in $SOURCE take effect immediately (no restart needed)."