Saturday, January 18, 2014

Linux tech tip: A simple update script for your opensim instances

This is most useful when you have multiple instances to upgrade. You can have one script per instance, or put them all together in one script. I do one per, naming each script for it's region i. e. world_one-update.sh ; world_two-update.sh , etc.
For Osgrid, you can  get the current release simply by using these commands to download to the same directory as the script:

wget http://download.osgrid.org/autowin/
wget -i index.html

#!/bin/sh
# place script in same level as directory containing your opensim instance
# i.e. myworld1/ myworld2/  myworld1-update.sh myworld2-update.sh all together in your opensim/osgrid directory for example
# do it anyway you wish, just keep your paths correct!
#
mkdir myworld_tmp
cp myworld/bin/config-include/FlotsamCache.ini myworld_tmp
cp myworld/bin/config-include/GridCommon.ini myworld_tmp
cp myworld/bin/Regions/Regions.ini myworld_tmp
cp myworld/bin/OpenSim.ini myworld_tmp
mv myworld myworld_$( date +%Y-%m-%d )
mkdir myworld
cd myworld
unzip ../osgrid*.zip
cd ../
cp myworld_tmp/FlotsamCache.ini myworld/bin/config-include
cp myworld_tmp/GridCommon.ini myworld/bin/config-include
cp myworld_tmp/Regions.ini myworld/bin/Regions
cp myworld_tmp/OpenSim.ini myworld/bin
rm -rf myworld_tmp

If you are using Sqlite instead of Mysql, you will also want to copy your OpenSim.db file over to the *_tmp file, and back into the updated version directory.