RU.MAC------------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 34 из 34
 От   : Dmitry Protasoff                    2:5001/100.1      27 окт 25 19:55:01
 К    : Sergei Zhavoronkoff                                   27 окт 25 19:56:01
 Тема : демон от su
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 2:5001/100.1 68ffa3e7
@REPLY: 2:5015/46.47 68ff9e39
@CHRS: CP866 2
@TZUTC: 0300
@TID: hpt/mac 1.9 2024-03-02
Hello, Sergei!

Monday October 27 2025 19:30, you wrote to All:

 SZ> Долго вступать не буду: на ХАКЕ с китайской матерью x99, если его


 Все таки немного грубовато (с паролем в скрипте). Давай вот такой
вариант попробуем:


1. /usr/local/bin/fix-bluetooth.sh:

-+-
#!/bin/bash

# Логирование для отладки, потом можно удалить
LOG_FILE="/var/log/bluetooth-fix.log"

echo "$(date): Checking Bluetooth status..." >> "$LOG_FILE"

# Проверяем текущее значение
btoff=$(nvram -p | grep "bluetoothExternalDongleFailed" 2>&1)

echo "$(date): Current value: $btoff" >> "$LOG_FILE"

if [[ "$btoff" != "bluetoothExternalDongleFailed"*"%00" ]]; then
    echo "$(date): Setting Bluetooth flag..." >> "$LOG_FILE"

    # HЕ HУЖЕH sudo - LaunchDaemon работает от root!
    nvram 7C436110-AB2A-4BBB-A880-FE41995C9F82:bluetoothExternalDongleFailed=%00

    if [[ $? -eq 0 ]]; then
        echo "$(date): Successfully set Bluetooth flag" >> "$LOG_FILE"
    else
        echo "$(date): Failed to set flag" >> "$LOG_FILE"
    fi
else
    echo "$(date): Bluetooth flag already correct" >> "$LOG_FILE"
fi
-+-

2. sudo chmod +x /usr/local/bin/fix-bluetooth.sh

3. /Library/LaunchDaemons/com.user.bluetoothfix.plist:


"http://www.apple.com/DTDs/PropertyList-1.0.dtd">


    Label
    com.user.bluetoothfix

    ProgramArguments
    
        /usr/local/bin/fix-bluetooth.sh
    


    RunAtLoad
    

    StandardOutPath
    /var/log/bluetooth-fix.log

    StandardErrorPath
    /var/log/bluetooth-fix-error.log



4.

sudo chown root:wheel /Library/LaunchDaemons/com.user.bluetoothfix.plist
sudo chmod 644 /Library/LaunchDaemons/com.user.bluetoothfix.plist

5.

sudo launchctl load /Library/LaunchDaemons/com.user.bluetoothfix.plist


Проверка статуса:

sudo launchctl list | grep bluetoothfix

Запуск для проверки:

sudo launchctl start com.user.bluetoothfix

Best regards,
             dp.

--- GoldED+/OSX 1.1.5-b20250409
 * Origin: All is good in St. John`s Wood (2:5001/100.1)
SEEN-BY: 4500/1 5001/3 100 5019/40 5020/101 545
715 848 1042 4441 12000
SEEN-BY: 5030/1081 5060/900
@PATH: 5001/100 5020/4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх