Created
January 20, 2014 14:31
-
-
Save ejoubaud/8520839 to your computer and use it in GitHub Desktop.
Symlink my ntfs external hard drive on mount on OSX - /System/Library/LaunchDaemons/com.ejoubaud.symlinkntfsdisk.plist
- /Users/ejoubaud/Library/Scripts/symlink_ntfs_disk
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \ | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<dict> | |
<key>Label</key> | |
<string>com.ejoubaud.symlinkntfsdisk</string> | |
<key>LowPriorityIO</key> | |
<true/> | |
<key>Program</key> | |
<string>/Users/ejoubaud/Library/Scripts/symlink_ntfs_disk.bash</string> | |
<key>WatchPaths</key> | |
<array> | |
<string>/Volumes</string> | |
</array> | |
</dict> | |
</plist> |
This file contains hidden or 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 | |
DIR=/Volumes | |
name=`ls -l $DIR | grep ejoubaud | grep Elements | awk 'BEGIN { max = 0 } { max = (max < $10) ? $10 : max } END { print "Elements " max }'` | |
if [ -d "$DIR/$name" ]; then | |
ln -fhs "$DIR/$name" "$DIR/myntfsdisk" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment