Created
March 24, 2016 19:18
-
-
Save tonybaltovski/011e2be2e5d41db6dbec to your computer and use it in GitHub Desktop.
pair-ds4.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Scanning for PS4 controller" | |
PS4=`hcitool scan | grep -e 'Wireless Controller' | head -1| sed 's/ //g'` | |
if [ -z "$PS4" ] ; then | |
echo "ERROR: No Controller found." | |
exit 1 | |
else | |
PS4_MAC=${PS4% Wireless*} | |
PS4_MAC=${PS4_MAC#* } | |
echo "Found controller with address: '$PS4_MAC'" | |
sudo bluez-simple-agent hci0 $PS4_MAC | |
sudo bluez-test-device trusted $PS4_MAC yes | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment