文書更新:2019年06月18日(火) 午前11時55分08秒

Home > 備忘録(Fedora) > bluetooth > bluetooth を起動時に off にする( 118 )

bluetooth を起動時に off にする

/etc/bluetooth/main.conf の [Policy] 部に「AutoEnable=false」と変更すればよいと別のホームページには書かれていますが、再起動すると bluetooth が起動してしまう場合がある。
  1. bluetooth を手動で off にする方法
  2. 手動で bluetooth を off にしたい場合には、次のようにすればよい。起動時に off にしたい場合には、これを実行する必要はない。
    [root@server]# rfkill block bluetooth
  3. 起動時に bluetooth を off
  4. 「rfkill block bluetooth」を「./.bash_profile」の最終行に追記する
    cat ./.bash_profile
    #追記
    rfkill block bluetooth
  5. 一括処理を考えた
  6. cat ./bluetooth.sh
    #!/bin/sh
    grep -e ^rfkill ./.bash_profile
    if [ $? -ne 0 ];then
    	sed -e "$ a rfkill block bluetooth" -i ./.bash_profile
    fi