Created
March 18, 2015 20:26
-
-
Save chrisgeo/80ed5e83188f0261b171 to your computer and use it in GitHub Desktop.
Enable and Disable Airplay Script
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/sh | |
####### | |
# | |
# Script to enable and disable airplay in OS X | |
# | |
######### | |
AIRPLAY=/System/Library/CoreServices/AirPlayUIAgent.app/Contents/MacOS/AirPlayUIAgent | |
disable() { | |
echo "Disabling airplay\n" | |
sudo chmod 000 $AIRPLAY | |
} | |
enable(){ | |
echo "Enabling Airplay Agent\n" | |
sudo chmod 755 $AIRPLAY | |
} | |
status(){ | |
stat=`stat -f %p $AIRPLAY` | |
if [[ stat -eq '100755' ]] ; then | |
echo "Airplay is enabled\n" | |
elif [[ stat -eq '100000' ]] ; then | |
echo "Airplay is disabled\n" | |
fi | |
} | |
case $1 in | |
enable) | |
enable | |
;; | |
disable) | |
disable | |
;; | |
status) | |
status | |
;; | |
*) | |
echo "Commands to use enable|disalbe" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment