I have a bash script which serves as a driver basically. For some reason Ubuntu cannot assign the Bluetooth Serial port on it's own. The script's function is to connect up a bluetooth device, then assign it a place to be accessed in /dev/bluetooth serial. Finally, when the device is disconnected, or terminated by pressing "q", it kills the port.
I would like to know if there is some way to execute a command in a bash script when the ctrl-C is executed so that it does not leave the unusable device in place in my /dev folder