/ freenet-upgrade.applescript
freenet-upgrade.applescript
 1  
 2  on clicked theObject
 3  	-- Read in the preferences
 4  	set theLocation to POSIX path of (call method "defaultObjectForKey:" with parameter "location")
 5  	
 6  	try
 7  		do shell script "cd " & theLocation & ";sh stop-freenet.sh"
 8  		tell progress indicator "progress" of window "main" to stop
 9  	on error
10  		-- do nothing as freenet may already be stopped
11  	end try
12  	try
13  		do shell script "cd " & theLocation & ";sh update.sh"
14  		display dialog "Freenet sucessfully upgraded to latest version. You may now restart Freenet."
15  	on error
16  		display dialog "Error: I encountered an unknown error trying to execute update.sh. Could update.sh be missing?"
17  	end try
18  end clicked
19