Created
September 14, 2010 21:20
-
-
Save ptone/579793 to your computer and use it in GitHub Desktop.
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 | |
# | |
FOLDER="$1" | |
echo $FOLDER | |
if [ -z "$FOLDER" ]; then | |
echo | |
echo "usage: $0 <folder>" | |
echo | |
exit 1 | |
fi | |
if [ ! -d "$FOLDER" ]; then | |
echo $FOLDER does not exist | |
exit 2 | |
fi | |
UserName=`basename "$FOLDER"` | |
Output="/Volumes/data/oldusers/$UserName.dmg" | |
echo clearing | |
rm -r "$FOLDER/Library/Caches" | |
rm -r "$FOLDER/.Trash" | |
rm -r "$FOLDER/.Spotlight-V100" | |
if [ -d "$FOLDER/Music" ]; then | |
rm -r "$FOLDER/Music" | |
fi | |
# echo changing-perms | |
# echo `chown -R x1admin "$FOLDER"` | |
#move out the iPhoto | |
if [ -d "$FOLDER/Pictures/iPhoto Library" ]; then | |
mv "$FOLDER/Pictures/iPhoto Library/" /Volumes/data/iphotos/$UserName | |
fi | |
echo creating-dmg | |
echo `hdiutil create -fs HFS+ -srcfolder "$FOLDER" -volname "$UserName" "$Output"` | |
echo deleting | |
rm -r "$FOLDER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment