mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 09:01:20 -08:00
Co-authored-by: Hannah Lindrob <[email protected]> Co-authored-by: Sapphire <[email protected]>
27 lines
692 B
Bash
27 lines
692 B
Bash
#!/bin/bash
|
|
|
|
SRC="/opt/SlimeVR/69-slimevr-devices.rules"
|
|
DESTDIRS=("/lib" "/usr/lib")
|
|
|
|
if [[ ! -f "$SRC" ]]; then
|
|
echo "SlimeVR udev rules not found, serial console and dongles may not work" >&2
|
|
exit 0
|
|
fi
|
|
|
|
echo "Configuring SlimeVR udev rules..."
|
|
|
|
for DIR in "${DESTDIRS[@]}"; do
|
|
if [[ -d "$DIR" && ! -h "$DIR" ]]; then
|
|
echo "Copying rules to $DIR"
|
|
install -Dm644 "$SRC" "$DIR/udev/rules.d/69-slimevr-devices.rules"
|
|
|
|
if command -v udevadm >/dev/null 2>&1; then
|
|
udevadm control --reload-rules
|
|
udevadm trigger
|
|
fi
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
echo "Couldn't copy SlimeVR udev rules, serial console and dongles may not work" >&2
|