Hi,
I am trying to write a script to turn on and off bluetooth.
At the moment I have two seperate scripts to do this, but I am trying to combine them into one script.
I want to check for the kbluetooth process, if this is running then I want to kill it and run rc.bluetooth stop
if it isn't running i want to run rc.bluetooth start and the start kbluetooth.
I have found this on the net that could check for the existence of hte kbluetooth process:
Code:
if ps ax | grep -v grep | grep kbluetooth > /dev/null
but I wanted to know if there was a better way of doing it, by checking PID's and how would I find the pid of kbluetooth?
Stuart