linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-users] Shell script during bluetooth connection
@ 2004-03-10 12:44 Lalith Chakravarthi
  2004-03-10 12:55 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Lalith Chakravarthi @ 2004-03-10 12:44 UTC (permalink / raw)
  To: bluez-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1128 bytes --]

Hi...

I want to execute a shell script whenever a bluetooth connection is
established. I am connecting between two computers using USB Dongles. I
have RedHat Linux 9 with 2.4.20-8 kernel. I am using the bnep
interface. I have already set up the ifcfg-bnepX files for that... but
I can't put the script there as it wont be an executable file there...

So cud you help me out with the files that will be called when a
connection using bnepX interface is created so that I can put my shell
script there..

thanks
Lalith

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Shell script during bluetooth connection
  2004-03-10 12:44 [Bluez-users] Shell script during bluetooth connection Lalith Chakravarthi
@ 2004-03-10 12:55 ` Marcel Holtmann
  2004-03-11  4:59   ` Lalith Chakravarthi
  2004-03-14 23:28   ` Pavel Ruzicka
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel Holtmann @ 2004-03-10 12:55 UTC (permalink / raw)
  To: Lalith Chakravarthi; +Cc: BlueZ Mailing List

Hi Lalith,

> I want to execute a shell script whenever a bluetooth connection is
> established. I am connecting between two computers using USB Dongles. I
> have RedHat Linux 9 with 2.4.20-8 kernel. I am using the bnep
> interface. I have already set up the ifcfg-bnepX files for that... but
> I can't put the script there as it wont be an executable file there...

I don't use RedHat, but in general there is not a big difference between
an executable file and an executable shell script. It is important that
the script is mode 755. However you can also put your script directly
into /etc/hotplug/net.agent.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Shell script during bluetooth connection
  2004-03-10 12:55 ` Marcel Holtmann
@ 2004-03-11  4:59   ` Lalith Chakravarthi
  2004-03-12 10:34     ` Marcel Holtmann
  2004-03-14 23:28   ` Pavel Ruzicka
  1 sibling, 1 reply; 5+ messages in thread
From: Lalith Chakravarthi @ 2004-03-11  4:59 UTC (permalink / raw)
  To: bluez-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1169 bytes --]

HI Marcel..
> 
> I don't use RedHat, but in general there is not a big difference
> between
> an executable file and an executable shell script. It is important
> that
> the script is mode 755. However you can also put your script directly
> into /etc/hotplug/net.agent.

When is the script /etc/hotplug/net.agent called? Is it when the USB
Dongle is plugged in??? Or is it when another USB device comes within
the range (I cant think of a way that this can happen without a
connexion)... or is it when a bluetooth connection is established??

Regards
Lalith

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Shell script during bluetooth connection
  2004-03-11  4:59   ` Lalith Chakravarthi
@ 2004-03-12 10:34     ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2004-03-12 10:34 UTC (permalink / raw)
  To: Lalith Chakravarthi; +Cc: bluez-users

Hi Lalith,

> When is the script /etc/hotplug/net.agent called? Is it when the USB
> Dongle is plugged in??? Or is it when another USB device comes within
> the range (I cant think of a way that this can happen without a
> connexion)... or is it when a bluetooth connection is established??

the net.agent is called when the new bnep0 (or any other network
interface) is created or released.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Shell script during bluetooth connection
  2004-03-10 12:55 ` Marcel Holtmann
  2004-03-11  4:59   ` Lalith Chakravarthi
@ 2004-03-14 23:28   ` Pavel Ruzicka
  1 sibling, 0 replies; 5+ messages in thread
From: Pavel Ruzicka @ 2004-03-14 23:28 UTC (permalink / raw)
  To: Lalith Chakravarthi; +Cc: BlueZ Mailing List

Hi,

> I don't use RedHat, but in general there is not a big difference between
> an executable file and an executable shell script. It is important that
> the script is mode 755. However you can also put your script directly
> into /etc/hotplug/net.agent.

I use net.agent from last hotplug tools.

Older net.agent, for example in Mandrake 9.2 doesn't have support for 2.6 
kernel (Action "add", not "register").

Script /etc/hotplug/net.agent is here:
-----------------------------------------------------------------------
#!/bin/bash
#
# Network hotplug policy agent for Linux 2.4 kernels
#
# Kernel NET hotplug params include:
#
#       ACTION=%s [register or unregister]
#       INTERFACE=%s
#
# HISTORY:
#
# 25-Feb-2001   Special case ppp and similar (redhat)
# 23-Jan-2001   Log invocation of "ifup" if debugging
# 04-Jan-2001   Initial version of "new" hotplug agent.
#
# $Id: net.agent,v 1.15 2003/10/07 19:56:24 kroah Exp $
#

cd /etc/hotplug
. hotplug.functions
# DEBUG=yes export DEBUG

if [ "$INTERFACE" = "" ]; then
    mesg Bad NET invocation: \$INTERFACE is not set
    exit 1
fi

case $ACTION in
add|register)
    # Don't do anything if the network is stopped
    if [ ! -f /var/lock/subsys/network ]; then
       exit 0
    fi

    case $INTERFACE in
        # interfaces that are registered after being "up" (?)
        ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
            debug_mesg assuming $INTERFACE is already up
            exit 0
            ;;
        # interfaces that are registered then brought up
        *)
            # NOTE:  network configuration relies on administered state,
            # we can't do much here without distro-specific knowledge
            # such as whether/how to invoke DHCP, set up bridging, etc.

            # RedHat and similar
            export IN_HOTPLUG=1
            if [ -x /sbin/ifup ]; then
                debug_mesg invoke ifup $INTERFACE
                exec /sbin/ifup $INTERFACE
            else
                mesg "how do I bring interfaces up on this distro?"
            fi
            ;;
    esac
    mesg $1 $ACTION event not handled
    ;;

*)
    debug_mesg NET $ACTION event not supported
    exit 1 ;;

esac
---------------------------------------------------------------------------------------
When I click "connect" on my Zaurus, my linux desktop automatically configure 
bnep0 interface.
Config file is here: /etc/sysconfig/network-scripts/ifcfg-bnep0
----------------------------------------------------------
DEVICE=bnep0
BOOTPROTO=static
IPADDR=192.168.130.1
NETMASK=255.255.255.0
ONBOOT=no
---------------------------------------------------------

If you want to have debug messages about hotplug, please uncomment this line:
"DEBUG=yes export DEBUG" in file /sbin/hotplug.
You found now debug messages in /var/log/messages.

Best regards,

Pavel Ruzicka



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-14 23:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-10 12:44 [Bluez-users] Shell script during bluetooth connection Lalith Chakravarthi
2004-03-10 12:55 ` Marcel Holtmann
2004-03-11  4:59   ` Lalith Chakravarthi
2004-03-12 10:34     ` Marcel Holtmann
2004-03-14 23:28   ` Pavel Ruzicka

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).