Skip to content

Instantly share code, notes, and snippets.

@yurrriq
Created October 12, 2017 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yurrriq/6b79e394fe024df83d1b6ef0288067d1 to your computer and use it in GitHub Desktop.
Save yurrriq/6b79e394fe024df83d1b6ef0288067d1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
toggle()
{
while (($#)); do
if [ -f "$1" ]; then
set -x
chmod $chmod_flags $1
{ set +x; } 2>/dev/null
fi
shift
done
}
case "$1" in
disable)
chmod_flags=a-r
;;
enable)
chmod_flags=a+r
;;
*)
echo "Usage: $0 [enable|disable]"
exit 1
esac
toggle /System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component/Contents/MacOS/QuickTimeUSBVDCDigitizer \
/System/Library/PrivateFrameworks/CoreMediaIOServices{,Private}.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC \
/System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC \
/Library/CoreMediaIO/Plug-Ins/DAL/AppleCamera.plugin/Contents/MacOS/AppleCamera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment