Last active
December 18, 2016 16:43
-
-
Save lfender6445/fa3f78f2f312fbba3bf1 to your computer and use it in GitHub Desktop.
Disable Mac Built In Camera (i-Sight) - shell 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/bash | |
# ------ Description ------ | |
# Shell script to enable and disable iSight macs built in camera | |
# Open terminal, follow instructions below | |
# ------ Installation ------ | |
# cd ~/Downloads && curl -0 https://gist.githubusercontent.com/lfender6445/fa3f78f2f312fbba3bf1/raw/805e30f3e40d0f3211823ccde5e5bf085aad022a/gistfile1.sh -o mac_camera.sh && chmod +x mac_camera.sh | |
# ------ Usage ------------- | |
# ./mac_camera.sh | |
osascript <<EOF | |
display dialog "Intel Mac iSight Disabler | |
brought to you by techslaves.org. | |
Version 5.0 | |
Support for Mavericks | |
Any applications currently using the iSight will continue to have access until they are quit or restarted." buttons {"Enable iSight", "Disable iSight"} with icon stop | |
set userChoice to button returned of result | |
set allDrivers to "" | |
tell application "Finder" | |
set driver to "/System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component/Contents/MacOS/QuickTimeUSBVDCDigitizer" | |
if exists driver as POSIX file then | |
set allDrivers to allDrivers & driver & " " | |
end if | |
set driver to "/System/Library/PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC" | |
if exists driver as POSIX file then | |
set allDrivers to allDrivers & driver & " " | |
end if | |
set driver to "/System/Library/PrivateFrameworks/CoreMediaIOServices.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC" | |
if exists driver as POSIX file then | |
set allDrivers to allDrivers & driver & " " | |
end if | |
set driver to "/System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC" | |
if exists driver as POSIX file then | |
set allDrivers to allDrivers & driver & " " | |
end if | |
set driver to "/Library/CoreMediaIO/Plug-Ins/DAL/AppleCamera.plugin/Contents/MacOS/AppleCamera" | |
if exists driver as POSIX file then | |
set allDrivers to allDrivers & driver | |
end if | |
end tell | |
if userChoice = "Enable iSight" then | |
do shell script "/bin/chmod a+r " & allDrivers with administrator privileges | |
else if userChoice = "Disable iSight" then | |
do shell script "/bin/chmod a-r " & allDrivers with administrator privileges | |
end if | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment