Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Apr 2008 21:03:49 +0200
From:      mato <gamato@users.sf.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>,  freebsd-bluetooth@freebsd.org
Subject:   Re: BT issues
Message-ID:  <47F67B95.4060402@users.sf.net>
In-Reply-To: <bb4a86c70803161729y51f376d0t8333c30713c646d6@mail.gmail.com>
References:  <47DBE7A4.3060006@users.sf.net> <bb4a86c70803161729y51f376d0t8333c30713c646d6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Maksim Yevmenkin wrote:
> 2) please cut and paste the following rc script into
> /etc/rc.d/rfcomm_pppd_server
>
> ==
>
> #!/bin/sh
> #
> # $FreeBSD$
> #
>
> # PROVIDE: rfcomm_pppd_server
> # REQUIRE: DAEMON sdpd
> # BEFORE: LOGIN
> # KEYWORD: nojail
>
> . /etc/rc.subr
>
> name="rfcomm_pppd_server"
> rcvar=`set_rcvar`
> command="/usr/sbin/rfcomm_pppd"
> command_args="-s"
> start_precmd="rfcomm_pppd_server_prestart"
> required_modules="ng_btsocket"
>
> rfcomm_pppd_server_prestart()
> {
>         if [ -n "${rfcomm_pppd_server_bd_addr}" ]; then
>                 command_args="${command_args} -a ${rfcomm_pppd_server_bd_addr}"
>         fi
>
>         command_args="${command_args} -C ${rfcomm_pppd_server_channel:-1}"
>
>         command_args="${command_args} -l
> ${rfcomm_pppd_server_label:-rfcomm-server}"
>
>         if checkyesno rfcomm_pppd_server_register_sp ; then
>                 command_args="${command_args} -S"
>         fi
>
>         if checkyesno rfcomm_pppd_server_register_dun ; then
>                 command_args="${command_args} -D"
>         fi
> }
>
> load_rc_config $name
> run_rc_command "$1"
>
> ==
>
> 3) to enable rfcomm_pppd server at boot time just add to your
> /etc/rc.conf the following line
>
> rfcomm_pppd_server_enanble="YES"
> rfcomm_pppd_server_channel=1  # EDIT THIS IF NEEDED
> rfcomm_pppd_server_label="rfcomm-server" # EDIT THIS IF NEEDED
> rfcomm_pppd_server_register_sp="NO"
> rfcomm_pppd_server_register_dun="NO"
>
> this should start rfcomm_pppd server on boot automatically. to
> start/stop rfcomm_pppd server at run time use
>
> /etc/rc.d/rfcomm_pppd start/stop
>
>   

Hi Max,

Thanks for the script but I would need it expanded a bit.  The thing is 
that because I connect both FreeBSD and Windows as clients I had to 
create 2 slightly different ppp.conf labels (it didn't work for me with 
one label only).  Therefore I created 2 simple scripts, each starting 
rfcomm_pppd with different label on different channel.  Then I run them 
manually or automatically from cron at startup.
Do you think it would be possible to cover situations like mine within 
your script ?  Something like specifying for instance 
rfcomm_pppd_server_channel="1,2" .. ?

Cheers,

Martin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47F67B95.4060402>