Re: Check for connections and disable bluetooth in shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Dienstag, den 31.08.2010, 03:04 -0300 schrieb Gustavo F. Padovan:
> > 
> > I want to disable bluetooth on my system (via commandline), if there is
> > no active bluetooth connection -- without being root.
> > 
> > Therefor I need a way to
> > 
> > 1.  check if there is an active bluetooth connection
> 
> 'hcitool conn' can show that to you.
> 

Just to complete this thread:

Thanks Gustavo! I'm now using the following script:

		if grep -q off-line /proc/acpi/ac_adapter/ACAD/state; then
			if !(hcitool con | grep -q "state"); then
				rfkill block bluetooth
			fi
		fi

May it be helpful for someone.

Greetings

Jonathan

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux