33 lines
1.2 KiB
Bash
Executable File
33 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# uninstall.sh — reverse install.sh. Removes the FlyCapture2 core libraries,
|
|
# the CLI tools, the udev rule and the example source. Leaves the '$GROUP'
|
|
# group, the GRUB USBFS setting and the apt dependencies in place (harmless,
|
|
# and other things may rely on them); comments below show how to undo those.
|
|
#
|
|
set -euo pipefail
|
|
|
|
UDEV_RULES="/etc/udev/rules.d/40-flir.rules"
|
|
|
|
[ "$(id -u)" -eq 0 ] || { echo "Run as root: sudo ./uninstall.sh" >&2; exit 1; }
|
|
|
|
echo "==> Removing FlyCapture2 packages"
|
|
dpkg -r libflycapture-c2-dev libflycapture-c2 libflycapture2-dev libflycapture2 2>/dev/null || true
|
|
|
|
echo "==> Removing CLI tools, viewer and example source"
|
|
rm -f /usr/local/bin/FlyCapture2Test /usr/local/bin/FlyCapture2Test_C /usr/local/bin/fc2view
|
|
rm -rf /usr/src/flycapture
|
|
|
|
echo "==> Removing udev rule"
|
|
rm -f "$UDEV_RULES"
|
|
udevadm control --reload-rules && udevadm trigger
|
|
|
|
cat <<'EOF'
|
|
|
|
Done. Not removed (undo manually if you want to):
|
|
* group 'flirimaging' -> sudo groupdelete flirimaging
|
|
* USBFS kernel arg -> edit /etc/default/grub, remove
|
|
'usbcore.usbfs_memory_mb=1000', then
|
|
sudo update-grub
|
|
EOF
|