FreeBSD Bugzilla – Attachment 217433 Details for
Bug 248584
usr.sbin/bluetooth/btpand: rc script to start btpand
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to head/libexec/rc/rc.d/btpand
patch-head-libexec-rc-rc.d-btpand.diff (text/plain), 3.60 KB, created by
Tatsuki Makino
on 2020-08-22 00:02:15 UTC
(
hide
)
Description:
patch to head/libexec/rc/rc.d/btpand
Filename:
MIME Type:
Creator:
Tatsuki Makino
Created:
2020-08-22 00:02:15 UTC
Size:
3.60 KB
patch
obsolete
>Index: head/libexec/rc/rc.d/btpand >=================================================================== >--- head/libexec/rc/rc.d/btpand (nonexistent) >+++ head/libexec/rc/rc.d/btpand (working copy) >@@ -0,0 +1,144 @@ >+#! /bin/sh >+# >+# $FreeBSD$ >+# >+ >+# PROVIDE: btpand >+# REQUIRE: FILESYSTEMS NETWORKING >+# REQUIRE: netif bluetooth >+# BEFORE: >+# KEYWORD: shutdown >+ >+. /etc/rc.subr >+. /etc/network.subr >+ >+name="btpand" >+desc="Bluetooth PAN daemon" >+rcvar="btpand_enable" >+start_precmd="btpand_start_precmd" >+stop_postcmd="btpand_stop_postcmd" >+required_modules="" >+required_vars="" >+ >+load_rc_config "${name}" >+ >+: ${btpand_enable="NO"} >+: ${btpand_tapif="tap0"} >+: ${btpand_device=""} >+: ${btpand_service="PANU"} >+: ${btpand_remote=""} >+ >+command="/usr/sbin/${name}" >+pidfile="/var/run/${btpand_tapif}.pid" >+ >+btpand_start_precmd () >+{ >+ local - >+ # tap(4): to keep configured addresses when btpand stopped >+ ${IFCONFIG_CMD} ${btpand_tapif} link0 >+} >+ >+btpand_stop_postcmd () >+{ >+ local - >+ if [ -f "${pidfile}" ] ; then >+ rm -f -- "${pidfile}" >+ fi >+} >+ >+btpand_setup_flags () >+{ >+ if ! ifexists ${btpand_tapif} ; then >+ warn >+ return 1 >+ fi >+ btpand_flags="${btpand_flags:-}${btpand_tapif:+ -i ${btpand_tapif}}" >+ >+ btpand_flags="${btpand_flags:-}${btpand_device:+ -d ${btpand_device}}" >+ >+ case "${btpand_service}" in # ( >+ [Nn][Aa][Pp]) >+ btpand_flags="${btpand_flags:-}${btpand_service:+ -s NAP}" >+ ;; # ( >+ [Gg][Nn]) >+ btpand_flags="${btpand_flags:-}${btpand_service:+ -s GN}" >+ ;; # ( >+ [Pp][Aa][Nn][Uu]) >+ btpand_flags="${btpand_flags:-}${btpand_service:+ -s PANU}" >+ ;; # ( >+ *) >+ warn "unsupported PAN service. use PANU." >+ btpand_flags="${btpand_flags:-}${btpand_service:+ -s PANU}" >+ ;; >+ esac >+ >+ # PANU client >+ btpand_flags="${btpand_flags:-}${btpand_remote:+ -a ${btpand_remote}}" >+} >+ >+btpand_run_rc_command_profile () >+{ >+ local - >+ local command command_args pidfile rcvar >+ local _rc_restart_done >+ local btpand_flags >+ local btpand_tapif btpand_device btpand_service >+ local profile _return >+ >+ profile="$1" >+ shift 1 >+ >+ eval "rcvar=\"btpand_${profile}_enable\"" >+ eval "btpand_flags=\"\${btpand_${profile}_flags:-${btpand_flags}}\"" >+ eval "btpand_tapif=\"\${btpand_${profile}_tapif:-${btpand_tapif}}\"" >+ eval "btpand_device=\"\${btpand_${profile}_device:-${btpand_device}}\"" >+ eval "btpand_service=\"\${btpand_${profile}_service:-${btpand_service}}\"" >+ eval "btpand_remote=\"\${btpand_${profile}_remote:-${btpand_remote}}\"" >+ eval "pidfile=\"/var/run/${btpand_tapif}.pid\"" >+ eval "_rc_restart_done=\"\${_rc_restart_done_btpand_${profile}:-false}\"" >+ >+ if ! btpand_setup_flags ; then >+ return 1 >+ fi >+ >+ run_rc_command ${1+"$@"} >+ _return="${?}" >+ >+ eval "_rc_restart_done_btpand_${profile}=\"\${_rc_restart_done:-false}\"" >+ >+ return "${_return}" >+} >+ >+if [ -n "${btpand_profiles}" ] ; then >+ btpand_rc_arg="$1" >+ if [ ${#} -gt 0 ] ; then >+ shift 1 >+ fi >+ >+ btpand_profiles="$(echo ${btpand_profiles})" >+ btpand_run_profiles="" >+ if [ -n "$*" ] ; then >+ for profile >+ do >+ case " ${btpand_profiles} " in # ( >+ *" ${profile} "*) >+ btpand_run_profiles="${btpand_run_profiles:+${btpand_run_profiles} }${profile}" >+ ;; >+ esac >+ done >+ else >+ btpand_run_profiles="${btpand_profiles}" >+ fi >+ >+ for profile in ${btpand_run_profiles} >+ do >+ echo "===> btpand profile: ${profile}" >+ btpand_run_rc_command_profile "${profile}" "${btpand_rc_arg}" >+ done >+else >+ if ! btpand_setup_flags ; then >+ return 1 >+ fi >+ >+ run_rc_command ${1+"$@"} >+fi > >Property changes on: head/libexec/rc/rc.d/btpand >___________________________________________________________________ >Added: svn:executable >## -0,0 +1 ## >+* >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248584
:
217142
|
217143
|
217146
| 217433