Skip to content

Instantly share code, notes, and snippets.

@jagtesh
Forked from tyilo/yosemite-bluetooth-fix.sh
Last active August 29, 2015 14:15

Revisions

  1. jagtesh revised this gist Feb 19, 2015. 1 changed file with 3 additions and 13 deletions.
    16 changes: 3 additions & 13 deletions yosemite-bluetooth-fix.sh
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,11 @@
    #!/bin/bash
    # Install sleepwatcher
    cd /tmp
    curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
    tar -zxvf sleepwatcher_2.2.tgz
    cd sleepwatcher_2.2
    sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
    sudo cp sleepwatcher /usr/local/sbin
    sudo cp sleepwatcher.8 /usr/local/share/man/man8
    sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
    sudo cp config/rc.* /etc
    cd ..
    rm -r sleepwatcher_2.2*
    sudo cp /usr/local/Cellar/sleepwatcher/2.2/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents/
    sudo cp /usr/local/Cellar/sleepwatcher/2.2/etc/sleepwatcher/rc.* /etc/c

    # Add bluetooth script to /etc/rc.wakeup (the script requires root)
    sudo tee -a /etc/rc.wakeup <<EOF
    kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport && sleep 3 && kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    EOF

    # Load the agent to start sleepwatcher
  2. @tyilo tyilo renamed this gist Dec 13, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @tyilo tyilo revised this gist Dec 10, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,8 @@ sudo cp sleepwatcher /usr/local/sbin
    sudo cp sleepwatcher.8 /usr/local/share/man/man8
    sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
    sudo cp config/rc.* /etc
    cd ..
    rm -r sleepwatcher_2.2*

    # Add bluetooth script to /etc/rc.wakeup (the script requires root)
    sudo tee -a /etc/rc.wakeup <<EOF
  4. @tyilo tyilo revised this gist Dec 10, 2014. 2 changed files with 20 additions and 12 deletions.
    20 changes: 20 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/bash
    # Install sleepwatcher
    cd /tmp
    curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
    tar -zxvf sleepwatcher_2.2.tgz
    cd sleepwatcher_2.2
    sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
    sudo cp sleepwatcher /usr/local/sbin
    sudo cp sleepwatcher.8 /usr/local/share/man/man8
    sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
    sudo cp config/rc.* /etc

    # Add bluetooth script to /etc/rc.wakeup (the script requires root)
    sudo tee -a /etc/rc.wakeup <<EOF
    kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    EOF

    # Load the agent to start sleepwatcher
    sudo launchctl load /Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility.plist
    12 changes: 0 additions & 12 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    cd /tmp
    curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
    tar -zxvf sleepwatcher_2.2.tgz
    cd sleepwatcher_2.2
    sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
    sudo cp sleepwatcher /usr/local/sbin
    sudo cp sleepwatcher.8 /usr/local/share/man/man8
    sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
    sudo cp config/rc.* /etc
    echo 'kextunload -b
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport; kextload -b
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport' >> /etc/rc.wake
  5. @tyilo tyilo created this gist Dec 10, 2014.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    cd /tmp
    curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
    tar -zxvf sleepwatcher_2.2.tgz
    cd sleepwatcher_2.2
    sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
    sudo cp sleepwatcher /usr/local/sbin
    sudo cp sleepwatcher.8 /usr/local/share/man/man8
    sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
    sudo cp config/rc.* /etc
    echo 'kextunload -b
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport; kextload -b
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport' >> /etc/rc.wake