#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "Installing udev rules for USB Crash Cart Adapter (vendor 152a, products 8460/8463)..."
sudo cp "$SCRIPT_DIR/udev-rules/"*.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

echo "Done. If the crash cart adapter is already plugged in, unplug and reconnect it."
