Skip to content

Instantly share code, notes, and snippets.

@featherbear
Last active October 12, 2017 15:31
Show Gist options
  • Save featherbear/a6b307175cfc09c2eaeb80ccb3d6dff8 to your computer and use it in GitHub Desktop.
Save featherbear/a6b307175cfc09c2eaeb80ccb3d6dff8 to your computer and use it in GitHub Desktop.
Install ntfs-3g driver on Mac
#!/bin/bash
echo Installing ntfs-3g driver! Notice, computer will restart twice during installation
if [ $EUID -ne 0 ]; then
echo Requesting sudo!
exec sudo $0
fi
echo Disabling system integrity protection
csrutil disable
echo Creating restart script
cat > /var/install_ntfs3g.sh << :EOF
/usr/bin/ruby -e "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install osxfuse -y
brew install ntfs-3g -y
mv /sbin/mount_ntfs /sbin/mount_ntfs.original
ln -s /usr/local/sbin/mount_ntfs /sbin/mount_ntfs
crontab -l | grep -v 'sh /var/install_ntfs3g.sh' | crontab -
csrutil enable
reboot
:EOF
chmod a+x /var/install_ntfs3g.sh
(crontab -l ; echo "@reboot sh /var/install_ntfs3g.sh") | crontab -
echo Restarting
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment