View Single Post
Old 03-11-2012, 01:43 AM   #6
dioioib
Enthusiast
dioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura aboutdioioib has a spectacular aura about
 
dioioib's Avatar
 
Posts: 44
Karma: 4154
Join Date: Jan 2012
Location: Canada
Device: Kobo Arc, Kobo Touch N905B
Here is a script I use for initialization with an image directory maintenance component added. This will work on MAC OSX by running it with terminal using
Code:
./kobo.sh
<- kobo.sh being the file name for the script.

If you cannot execute the script type the following to make the file executable.

Code:
chmod +x kobo.sh
This is the data for your kobo.sh file.

Code:
#!/bin/sh
#KOBOeReader setup script for OSX.
#Make sure the Kobo's drive label has not 
#been changed from KOBOeReader. 
#Created by Brian Durocher March 2012
#brian.durocher@gmail.com
#Creative Commons Share-a-like Licence. 
echo
echo "3 Stage Setup and Maintenance Script"
echo
echo "Unteathered setup. Only do this if you don't intent to use the Kobo with the Desktop Application"
echo
read -p "Would you like to intialize your kobo using the 'foo' initialization method: (yes|no) " -r
if [ "${REPLY}" == "yes" ]
	then
		echo
		read -p "Please make sure your KOBO is plugged into a USB port and press return: "
		echo "insert into user values('foo', 'foo', 'foo', 'foo', 'foo');" | sqlite3 /Volumes/KOBOeReader/.kobo/KoboReader.sqlite
		echo "Activation completed"
		echo
	else
		echo
		echo "Skipping initialization"
		echo
fi
read -p "Do you want to disable Spotlight Indexing and Trash on your Kobo device: (yes|no) " -r
if [ "${REPLY}" == "yes" ]
	then
		echo
		echo "Removing Spotlight Indexing and Trash on KOBOeReader."
		mdutil -i off /Volumes/KOBOeReader
		cd /Volumes/KOBOeReader
		rm -rf .{,_.}{fseventsd,Spotlight-V*,Trashes}
		mkdir .fseventsd
		touch .fseventsd/no_log .metadata_never_index .Trashes
		cd -
		echo
		echo "Complete..."
		echo
	else
		echo
		echo "Skipping Data Saving Measures"
		echo		
fi
echo 
read -p "Do you want to clean the image directory: (yes|no) " -r
if [ "${REPLY}" == "yes" ]
	then
		rm -vf /Volumes/KOBOeReader/.kobo/images/*.N3_FULL.parsed
		rm -vf /Volumes/KOBOeReader/.kobo/images/*N3_LIBRARY_SHELF.parsed
		rm -vf /Volumes/KOBOeReader/.kobo/images/*N3_SOCIAL_CURRENTREAD.parsed
	else
		echo
		echo "Skipping Image Folder Clean-up"
		echo
fi
Small modifications can be made to make this function with Linux. Email or PM me if you want me to make additional changes.
dioioib is offline   Reply With Quote