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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to