Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # special thanks to @landonfuller
- # this is his fix / patch. Just my script.
- # ~John
- PATCHFILE="/System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/Current/DataDetectorsCore"
- #PATCHFILE="/tmp/DataDetectorsCore"
- printf "\n === Patches OSX 10.8.2 DataDetectorsCore file to bypass the File:/// bug === \n"
- if [ "$(id -u)" != "0" ]; then
- printf "\n\n ERROR: This script must be run using sudo.\n Example: sudo ./Filefix.sh \n\n" 1>&2
- exit 1
- fi
- FALSE=1
- TRUE=0
- function shasum_isgood {
- printf "\n + Checking file SHA sum : "
- SHASUM=$( shasum $PATCHFILE )
- printf $SHASUM | grep $1
- if [ $? -eq 0 ]; then
- printf " ++ PASS\n"
- return $TRUE
- fi
- printf "FAIL"
- return $FALSE
- }
- function patch_file {
- printf "\n + Patching file: "
- printf '\xeb' | dd bs=1 seek=646039 count=1 conv=notrunc of=$PATCHFILE
- printf " ++ DONE\n"
- }
- function backup_original {
- printf "\n + Backing up original file in $HOME : "
- cp -vf $PATCHFILE $HOME
- PRINTF " ++ DONE\n"
- }
- if shasum_isgood 3fe12fd274433877c9e307ba9c09a06dde11882e ; then
- backup_original
- patch_file
- else
- printf "\n\n + ERROR: File version mismatch. Patching aborted.\n\n"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement