003 File Manager
Current Path:
/usr/sbin
usr
/
sbin
/
📁
..
📄
ac
(10.36 KB)
📄
accton
(5.66 KB)
📄
acpiconf
(9.14 KB)
📄
acpidb
(496.75 KB)
📄
acpidump
(39.86 KB)
📄
adduser
(23.38 KB)
📄
ancontrol
(34.19 KB)
📄
apm
(13.1 KB)
📄
arp
(17.88 KB)
📄
ath3kfw
(14.51 KB)
📄
audit
(5.98 KB)
📄
auditd
(21.79 KB)
📄
auditdistd
(127.49 KB)
📄
auditreduce
(15.34 KB)
📄
authpf
(20.57 KB)
📄
authpf-noip
(20.57 KB)
📄
automount
(50.65 KB)
📄
automountd
(50.65 KB)
📄
autounmountd
(50.65 KB)
📄
bcmfw
(8.68 KB)
📄
bhyve
(374.03 KB)
📄
bhyvectl
(41.55 KB)
📄
bhyveload
(16.41 KB)
📄
binmiscctl
(14.12 KB)
📄
blacklistctl
(33.88 KB)
📄
blacklistd
(41.85 KB)
📄
bluetooth-config
(9.71 KB)
📄
boot0cfg
(15.09 KB)
📄
bootparamd
(15.81 KB)
📄
bootpef
(38.09 KB)
📄
bootptest
(17.37 KB)
📄
bsdconfig
(11.98 KB)
📄
bsdinstall
(3.44 KB)
📄
bsnmpd
(136.55 KB)
📄
bthidcontrol
(36.06 KB)
📄
bthidd
(55.51 KB)
📄
btpand
(32.42 KB)
📄
btxld
(13.49 KB)
📄
callbootd
(9.26 KB)
📄
camdd
(37.59 KB)
📄
cdcontrol
(22.45 KB)
📄
certctl
(7.74 KB)
📄
chkgrp
(9.04 KB)
📄
chkprintcap
(18.22 KB)
📄
chown
(10.23 KB)
📄
chroot
(8.31 KB)
📄
ckdist
(16.18 KB)
📄
clear_locks
(6.23 KB)
📄
config
(56.23 KB)
📄
cpucontrol
(20.03 KB)
📄
crashinfo
(8.21 KB)
📄
cron
(44.9 KB)
📄
ctladm
(66.98 KB)
📄
ctld
(123.97 KB)
📄
cxgbetool
(2.86 MB)
📄
daemon
(15.76 KB)
📄
dconschat
(22.84 KB)
📄
devctl
(11.83 KB)
📄
devinfo
(8.68 KB)
📄
diskinfo
(19.2 KB)
📄
dtrace
(35.91 KB)
📄
dumpcis
(26.69 KB)
📄
dwatch
(36.59 KB)
📄
editmap
(84.02 KB)
📄
edquota
(22.9 KB)
📄
efibootmgr
(22.04 KB)
📄
efidp
(9.79 KB)
📄
efivar
(14.77 KB)
📄
etcupdate
(43.94 KB)
📄
extattrctl
(16.63 KB)
📄
fdcontrol
(14.94 KB)
📄
fdformat
(18.52 KB)
📄
fdread
(17.14 KB)
📄
fdwrite
(10.19 KB)
📄
fifolog_create
(9.03 KB)
📄
fifolog_reader
(31.19 KB)
📄
fifolog_writer
(15.57 KB)
📄
flowctl
(12.19 KB)
📄
fmtree
(36.11 KB)
📄
freebsd-update
(91.6 KB)
📄
fstyp
(19.38 KB)
📄
ftp-proxy
(28.19 KB)
📄
fwcontrol
(32.87 KB)
📄
gensnmptree
(29.26 KB)
📄
getextattr
(11.24 KB)
📄
getfmac
(6.78 KB)
📄
getpmac
(6.9 KB)
📄
gpioctl
(11.71 KB)
📄
gssd
(34.37 KB)
📄
gstat
(23.22 KB)
📄
hccontrol
(174.81 KB)
📄
hcsecd
(30.18 KB)
📄
hcseriald
(10.12 KB)
📄
hostapd
(876.65 KB)
📄
hostapd_cli
(79.18 KB)
📄
hoststat
(8.41 KB)
📄
hv_kvp_daemon
(21.99 KB)
📄
hv_vss_daemon
(9.45 KB)
📄
i2c
(14.99 KB)
📄
iasl
(1.34 MB)
📄
idprio
(7.61 KB)
📄
ifmcstat
(12.74 KB)
📄
inetd
(47.88 KB)
📄
iostat
(19.66 KB)
📄
iovctl
(19.91 KB)
📄
ip6addrctl
(12.2 KB)
📄
ipfwpcap
(10.79 KB)
📄
iprop-log
(24.89 KB)
📄
iscsid
(37.38 KB)
📄
iwmbtfw
(19.09 KB)
📄
jail
(68.96 KB)
📄
jexec
(8.85 KB)
📄
jls
(15.11 KB)
📄
kbdcontrol
(39.62 KB)
📄
kbdmap
(16.16 KB)
📄
keyserv
(24.67 KB)
📄
kgmon
(13.02 KB)
📄
kldxref
(29.59 KB)
📄
kstash
(9.68 KB)
📄
ktutil
(38.81 KB)
📄
l2control
(12.84 KB)
📄
l2ping
(10.6 KB)
📄
lastlogin
(8.5 KB)
📄
local-unbound
(148.45 KB)
📄
local-unbound-anchor
(38.63 KB)
📄
local-unbound-checkconf
(29.43 KB)
📄
local-unbound-control
(33.32 KB)
📄
local-unbound-setup
(11.7 KB)
📄
lockstat
(49.98 KB)
📄
lpc
(55.95 KB)
📄
lpd
(82.2 KB)
📄
lptcontrol
(6.48 KB)
📄
lptest
(6.03 KB)
📄
lsextattr
(11.24 KB)
📄
mailstats
(73.28 KB)
📄
mailwrapper
(8.41 KB)
📄
makefs
(183.64 KB)
📄
makemap
(89.47 KB)
📄
manctl
(7.75 KB)
📄
memcontrol
(11.88 KB)
📄
mergemaster
(43.59 KB)
📄
mfiutil
(75.3 KB)
📄
mixer
(12.14 KB)
📄
mld6query
(10.53 KB)
📄
mlx5tool
(11.54 KB)
📄
mlxcontrol
(19.72 KB)
📄
mount_smbfs
(15.29 KB)
📄
mountd
(54.05 KB)
📄
moused
(40.59 KB)
📄
mprutil
(33.95 KB)
📄
mpsutil
(33.95 KB)
📄
mptable
(15.74 KB)
📄
mptutil
(46.35 KB)
📄
mtest
(17.24 KB)
📄
mtree
(60.94 KB)
📄
ndis_events
(9.19 KB)
📄
ndiscvt
(39.78 KB)
📄
ndisgen
(15.83 KB)
📄
ndp
(24.03 KB)
📄
newsyslog
(46.39 KB)
📄
nfscbd
(10.15 KB)
📄
nfsd
(22.62 KB)
📄
nfsdumpstate
(8.02 KB)
📄
nfsrevoke
(6.08 KB)
📄
nfsuserd
(16.87 KB)
📄
ngctl
(29.15 KB)
📄
nghook
(10.09 KB)
📄
nmtree
(60.94 KB)
📄
nologin
(625.77 KB)
📄
nscd
(87.91 KB)
📄
ntp-keygen
(205.75 KB)
📄
ntpd
(842.26 KB)
📄
ntpdate
(126.85 KB)
📄
ntpdc
(268.29 KB)
📄
ntptime
(83.42 KB)
📄
pac
(28.74 KB)
📄
pciconf
(37.38 KB)
📄
periodic
(4.19 KB)
📄
pkg
(32.22 KB)
📄
plockstat
(22.91 KB)
📄
pmc
(167.45 KB)
📄
pmcannotate
(15.8 KB)
📄
pmccontrol
(11.81 KB)
📄
pmcstat
(77.77 KB)
📄
pnfsdscopymr
(9.09 KB)
📄
pnfsdsfile
(10.01 KB)
📄
pnfsdskill
(6.26 KB)
📄
portsnap
(29.86 KB)
📄
powerd
(15.97 KB)
📄
ppp
(427.13 KB)
📄
pppctl
(15.77 KB)
📄
praliases
(86.38 KB)
📄
praudit
(9.13 KB)
📄
prometheus_sysctl_exporter
(13.91 KB)
📄
pstat
(14.47 KB)
📄
purgestat
(8.41 KB)
📄
pw
(74.28 KB)
📄
pwd_mkdb
(16.71 KB)
📄
pwm
(10.45 KB)
📄
quot
(14.92 KB)
📄
quotaoff
(8.29 KB)
📄
quotaon
(8.29 KB)
📄
rarpd
(16.11 KB)
📄
repquota
(11.14 KB)
📄
rfcomm_pppd
(13.8 KB)
📄
rip6query
(7.69 KB)
📄
rmextattr
(11.24 KB)
📄
rmt
(9.48 KB)
📄
rmuser
(8.96 KB)
📄
route6d
(46.17 KB)
📄
rpc.lockd
(64.46 KB)
📄
rpc.statd
(22.27 KB)
📄
rpc.umntall
(12.3 KB)
📄
rpc.yppasswdd
(41.08 KB)
📄
rpc.ypupdated
(18.19 KB)
📄
rpc.ypxfrd
(16.12 KB)
📄
rpcbind
(43.91 KB)
📄
rrenumd
(34.28 KB)
📄
rtadvctl
(31.52 KB)
📄
rtadvd
(70.95 KB)
📄
rtprio
(7.61 KB)
📄
rtsold
(40.09 KB)
📄
rwhod
(17.15 KB)
📄
sa
(23.57 KB)
📄
sade
(48.1 KB)
📄
sdpcontrol
(15.98 KB)
📄
sdpd
(38.07 KB)
📄
sendmail
(8.41 KB)
📄
service
(4.84 KB)
📄
services_mkdb
(14.02 KB)
📄
sesutil
(20.83 KB)
📄
setextattr
(11.24 KB)
📄
setfib
(7.2 KB)
📄
setfmac
(14.27 KB)
📄
setfsmac
(14.27 KB)
📄
setpmac
(6.11 KB)
📄
smbmsg
(10.09 KB)
📄
snapinfo
(7.46 KB)
📄
sntp
(324.31 KB)
📄
spi
(15.59 KB)
📄
spkrtest
(3.62 KB)
📄
spray
(7.8 KB)
📄
sshd
(302.45 KB)
📄
swapinfo
(14.47 KB)
📄
syslogd
(53.15 KB)
📄
sysrc
(22.64 KB)
📄
tcpdchk
(19.85 KB)
📄
tcpdmatch
(16.88 KB)
📄
tcpdrop
(10.25 KB)
📄
tcpdump
(936.43 KB)
📄
traceroute
(33.23 KB)
📄
traceroute6
(30.32 KB)
📄
trim
(9.41 KB)
📄
trpt
(11.45 KB)
📄
tzsetup
(20.19 KB)
📄
uathload
(9.28 KB)
📄
uefisign
(20.87 KB)
📄
ugidfw
(8.57 KB)
📄
uhsoctl
(26.11 KB)
📄
usbconfig
(26.59 KB)
📄
usbdump
(16.42 KB)
📄
utx
(7.81 KB)
📄
valectl
(12.23 KB)
📄
vidcontrol
(27.79 KB)
📄
vidfont
(16.16 KB)
📄
vigr
(2.42 KB)
📄
vipw
(7.2 KB)
📄
wake
(7.33 KB)
📄
watch
(12.79 KB)
📄
watchdog
(15.37 KB)
📄
watchdogd
(15.37 KB)
📄
wlandebug
(16.26 KB)
📄
wpa_cli
(529.82 KB)
📄
wpa_passphrase
(37.72 KB)
📄
wpa_supplicant
(926.5 KB)
📄
yp_mkdb
(11.82 KB)
📄
ypbind
(20.45 KB)
📄
ypinit
(8.8 KB)
📄
ypldap
(93.28 KB)
📄
yppoll
(7.91 KB)
📄
yppush
(23.81 KB)
📄
ypserv
(43.55 KB)
📄
ypset
(7.36 KB)
📄
zdb
(164.94 KB)
📄
zdump
(13.48 KB)
📄
zfsd
(102.01 KB)
📄
zhack
(16.02 KB)
📄
zic
(42.48 KB)
📄
zonectl
(13.94 KB)
📄
zzz
(1.23 KB)
Editing: bluetooth-config
#!/bin/sh #- # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # <erdgeist@erdgeist.org> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp # ---------------------------------------------------------------------------- # # $FreeBSD$ # # define our bail out shortcut exerr () { echo -e "Error: $*" >&2 ; exit 1; } print_syntax () { echo -e "Syntax: $0 scan [-d device] [-n node]"; exit 1; } main() { unset node device started bdaddresses retry # Only one command at the moment is scan (+ add) [ "$#" -eq 1 -a "$1" = "scan" ] || print_syntax shift # Get command line options while getopts :d:n: arg; do case ${arg} in d) device="$OPTARG";; n) node="$OPTARG";; ?) print_syntax;; esac done # No use running without super user rights if [ $( id -u ) -ne 0 ]; then exerr "$0 must modify files that belong to root. Re-run as root." fi known_nodes=$( /usr/sbin/hccontrol read_node_list 2>/dev/null |\ /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) # Check if netgraph knows about any HCI nodes if ! [ "${known_nodes}" ]; then ng_nodes=$( /usr/sbin/ngctl list 2>/dev/null | \ /usr/bin/grep -o "Name: .* Type: ubt" |/usr/bin/cut -d' ' -f2 ) [ "${ng_nodes}" ] || exerr "No Bluetooth host controllers found." unset found for n in ${ng_nodes}; do if [ "${n}" = "${node%hci}" ]; then # Found the node but its stack is not set up? Do it now. /usr/sbin/service bluetooth start ${node%hci} || exit 1 found="YES" fi done # If we have Bluetooth controller nodes without a set up stack, # ask the user if we shall start it up if ! [ "${found}" ]; then printf "No usable Bluetooth host controllers were found.\n" printf "These host controllers exist in the system:\n" printf " %s\n" "${ng_nodes}" prompt="Choose a host controller to set up: [${ng_nodes%% *}]" read -p "${prompt}" node : ${node:="${ng_nodes%% *}"} /usr/sbin/service bluetooth start ${node} || exit 1 fi # Re-read known nodes known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) # check if we succeeded in bringing it up [ "${known_nodes}" ] || exerr "Failed to set up Bluetooth stack" fi # if a node was requested on command line, check if it is there if [ "${node}" ]; then unset found for n in ${known_nodes}; do [ "${n}" = "${node}" ] && found="YES" [ "${n}" = "${node}hci" ] && node="${node}hci" && found="YES" done [ "${found}" ] || exerr "Node ${node} not found" fi [ "${node}" ] && node="-n ${node}" while ! [ "${bdaddresses}" ]; do retry=X${retry} printf "Scanning for new Bluetooth devices (Attempt %d of 5) ... " \ ${#retry} bdaddresses=$( /usr/sbin/hccontrol -N ${node} inquiry 2>/dev/null | /usr/bin/grep -o "BD_ADDR: .*" | /usr/bin/cut -d ' ' -f 2 ) # Count entries and, if a device was requested on command line, # try to find it unset found count for bdaddress in ${bdaddresses}; do count=X${count} if [ "${bdaddress}" = "${device}" ]; then found=YES bdaddresses="${device}" count=X break fi done # If device was requested on command line but is not found, # or no devices found at all, rescan until retry is exhausted if ! [ "${found}" -o "${count}" -a -z "${device}" ]; then printf "failed.\n" if [ "${#retry}" -eq 5 ]; then [ "${device}" ] && exerr "Device ${device} not found" exerr "No new Bluetooth devices found" fi unset bdaddresses sleep 2 continue fi [ ${#count} -gt 1 ] && plural=s || plural='' printf "done.\nFound %d new bluetooth device%s " ${#count} ${plural} printf "(now scanning for names):\n" # Looping again for the faster feedback unset count for bdaddress in ${bdaddresses}; do count=X${count} bdname=$( /usr/bin/bthost -b "${bdaddress}" 2>/dev/null ) friendlyname=$( /usr/sbin/hccontrol Remote_Name_Request \ ${bdaddress} 2> /dev/null | /usr/bin/grep -o "Name: .*" |/usr/bin/cut -d ' ' -f 2- ) # sdpcontrol should be able to pull vendor + product id via sdp printf "[%2d] %s\t\"%s\" (%s)\n" ${#count} "${bdaddress}" \ "${friendlyname}" "${bdname}" eval bdaddress_${#count}=\${bdaddress} eval bdname_${#count}=\${bdname} eval friendlyname_${#count}=\${friendlyname} done # If a device was pre-selected, do not query the user [ "${device}" ] && topair=1 || unset topair # Even if only one device was found, user may chose 0 to rescan while ! [ "${topair}" ]; do prompt="Select device to pair with [1" [ ${#count} -gt 1 ] && prompt="${prompt}-${#count}" read -p "${prompt}, or 0 to rescan]: " topair if ! [ "${topair}" -ge 0 -a "${topair}" -le "${#count}" ] \ 2>/dev/null ; then printf "Value out of range: %s.\n" {topair} unset topair fi done [ "${topair}" -eq "0" ] && unset bdaddresses retry done eval bdaddress=\${bdaddress_${topair}} eval bdname=\${bdname_${topair}} eval friendlyname=\${friendlyname_${topair}} # Do we need to add an entry to /etc/bluetooth/hosts? if ! [ "${bdname}" ]; then printf "\nAdding device ${bdaddress} to /etc/bluetooth/hosts.\n" while ! [ "${bdname}" ]; do read -p "Enter friendly name. [${friendlyname}]: " _r : ${_r:="${friendlyname}"} if [ "${_r}" ]; then # Remove white space and non-friendly characters bdname=$( printf "%s" "${_r}" | tr -c '[:alnum:]-,.' _ ) if [ "${_r}" != "${bdname}" ]; then printf "Notice: Using sanitized name" printf "\"%s\" in /etc/bluetooth/hosts.\n" \ "${bdname}" fi fi done printf "%s\t%s\n" "${bdaddress}" "${bdname}" >> /etc/bluetooth/hosts fi # If scanning for the name did not succeed, resort to bdname : ${friendlyname:="${bdname}"} # now over to hcsecd # Since hcsecd does not allow querying for known devices, we need to # check for bdaddr entries manually. # # Also we cannot really modify the PIN in an existing entry. So we # need to prompt the user to manually do it and restart this script if ! /usr/sbin/service hcsecd enabled; then printf "\nWarning: hcsecd is not enabled.\n" printf "This daemon manages pairing requests.\n" read -p "Enable hcsecd? [yes]: " _r case "${_r}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/service hcsecd enable;; esac fi secd_config=$( /usr/sbin/sysrc -n hcsecd_config ) secd_entries=$( /usr/bin/grep -Eo "bdaddr[[:space:]]+(${bdaddress}|${bdname})" \ ${secd_config} | awk '{ print $2; }' ) if [ "${secd_entries}" ]; then printf "\nWarning: An entry for device %s is already present in %s.\n" \ ${secd_entries} ${secd_config} printf "To modify pairing information, edit this file and run\n" printf " service hcsecd restart\n" read -p "Continue? [yes]: " _r case "${_r}" in no|n|NO|N|No|nO) exit;; esac else printf "\nWriting pairing information description block to %s.\n" \ ${secd_config} printf "(To get PIN, put device in pairing mode first.)\n" read -p "Enter PIN [nopin]: " pin [ "${pin}" ] && pin=\""${pin}"\" || pin="nopin" # Write out new hcsecd config block printf "\ndevice {\n\tbdaddr\t%s;\n\tname\t\"%s\";\n\tkey\tnokey\;\n\tpin\t%s\;\n}\n" \ "${bdaddress}" "${friendlyname}" "${pin}" >> ${secd_config} # ... and make daemon reload config # TODO: hcsecd should provide a reload hook /usr/sbin/service hcsecd onerestart # TODO: we should check if hcsecd succeeded pairing and revert to an # old version of hcsecd.conf so we can undo adding the block above and # retry with a new PIN # also, if there's a way to force devices to re-pair, try this fi # now check for specific services to be provided by the device # first up: HID /usr/sbin/sdpcontrol -a "${bdaddress}" search HID | \ /usr/bin/grep -q "^Record Handle: " || exit 0 printf "\nThis device provides human interface device services.\n" read -p "Set it up? [yes]: " _r case "${_r}" in no|n|NO|N|No|nO) exit 0;; *);; esac # Here we have found an HID and were asked to set it up # NOTE: look out for the two exit 0 above if you extend this script if ! /usr/sbin/service bthidd enabled; then printf "\nWarning: bthidd is not enabled." printf "\nThis daemon manages Bluetooth HID devices.\n" read -p "Enable bthidd? [yes]: " _r case "${_r}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/service bthidd enable;; esac fi # Check if bthidd already knows about this device bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ /usr/bin/grep "${bdaddress}" ) if [ "${bthidd_known}" ]; then printf "Notice: Device %s already known to bthidd.\n" "${bdaddress}" return 0 fi bthidd_config=$( /usr/sbin/sysrc -n bthidd_config ) printf "Writing HID descriptor block to %s ... " "${bthidd_config}" /usr/sbin/bthidcontrol -a "${bdaddress}" query >> "${bthidd_config}" # Re-read config to see if we succeeded adding the device bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ grep "${bdaddress}" ) if ! [ "${bthidd_known}" ]; then printf "failed.\n" else printf "success.\nTo re-read its config, bthidd must be restarted.\n" printf "Warning: If a Bluetooth keyboard is being used, the connection" printf "might be lost.\n" printf "It can be manually restarted later with\n" printf " service bthidd restart\n" read -p "Restart bthidd now? [yes]: " _r case "${_r}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/service bthidd onerestart;; esac fi } # After function definitions, main() can use them main "$@" exit 0 # TODO # * If device is a keyboard, offer a text entry test field and if it does # not succeed, leave some clues for debugging (i.e. if the node responds # to pings, maybe switch keyboard on/off, etc) # * Same if device is a mouse, i.e. hexdump /dev/sysmouse. # * If device offers DUN profiles, ask the user if an entry in # /etc/ppp/ppp.conf should be created # * If OPUSH or SPP is offered, refer to the respective man pages to give # some clues how to continue
Upload File
Create Folder