linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Haug <jonathanhaug@wolke7.net>
To: linux-bluetooth@vger.kernel.org
Subject: Re: Check for connections and disable bluetooth in shell
Date: Thu, 07 Oct 2010 07:01:00 +0200	[thread overview]
Message-ID: <1286427660.2181.5.camel@josua> (raw)
In-Reply-To: <20100831060429.GA15844@vigoh>

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


      reply	other threads:[~2010-10-07  5:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31  5:58 Check for connections and disable bluetooth in shell Jonathan Haug
2010-08-31  6:04 ` Gustavo F. Padovan
2010-10-07  5:01   ` Jonathan Haug [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286427660.2181.5.camel@josua \
    --to=jonathanhaug@wolke7.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).