So, now i have made an udev rule that automatically starts MantaOSC when plugged in and kills it when disconnected. This is in my 99-manta.rules file:
ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="2424/2424/1", RUN+="/lib/udev/manta-connect.sh"
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="2424/2424/1", RUN+="/lib/udev/manta-disconnect.sh"
The “add” action works fine and the “remove” seems to kill MantaOSC, but it strangely restarts again after a 2 seconds or so, forcing me to run the script again. Maybe this is a bug in MantaOSC? Or should i improve something in my rules or scripts?
My connect / disconnect scripts are simple:
#!/bin/bash
/home/we/libmanta/MantaOSC/build/MantaOSC
#!/bin/bash
killall MantaOSC