opensim-tools

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 27  →  ?path2? @ 28
/lib/upgrade-spectacled-owl
@@ -5,16 +5,20 @@
## rights of fair usage, the disclaimer and warranty conditions. ##
###########################################################################
 
dialog --msgbox "This tool will upgrade the Spectacled Owl machine." 10 70
 
pushd ./
if [ -d ../opensim-sources ]; then
if [ -d ../opensim-sources/ ]; then
cd ../opensim-sources/
echo "[SpectacledOwl] Updating sources..."
svn update
echo "[SpectacledOwl] Cleaning..."
PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make clean
echo "[SpectacledOwl] Build..."
PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make
if [ -d /home/opensim/os ]; then
dialog --yesno "By slecting yes here, the OpenSim sources will be updated from the development repository, compiled and added to the current OpenSim working directory. Selecting yes here will not affect any modifications you may have done to OpenSim's ini files. Upgrade the OpenSim binaries to the lastest development version?" 10 70
if [ ?$ == "0" ]; then
echo "[SpectacledOwl] Cleaning..."
PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make clean
echo "[SpectacledOwl] Build..."
PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make
if [ -d /home/opensim/os ]; then
echo "[SpectacledOwl] Copying files..."
mkdir -p /home/opensim/os
find bin/ -name \*.ini -exec rm -rf '{}' \;
@@ -24,29 +28,40 @@
chown -R opensim:opensim /home/opensim/os/
fi
fi
if [ -d ../opensim-config ]; then
echo "[SpectacledOwl] Updating configuration..."
if [ -d ../opensim-config/ ]; then
cd ../opensim-config/
svn update
cp -Ra * /home/opensim/os/
dialog --yesno "This option will update OpenSim's configuration files EXCEPT Regions.ini which will not be touched. It is useful to synchronize OpenSim's configuration files with new options from the development branch. If you have made changes to OpenSim's ini files, a resonable answer will be no. However, at some point you should make a backup and sync with the development version. Update the configuration files now?" 10 70
if [ $? == "0" ]; then
echo "[SpectacledOwl] Updating configuration..."
cp -Ra * /home/opensim/os/
fi
fi
if [ -d /var/opensim-www ]; then
echo "[SpectacledOwl] Updating website..."
cd /var/opensim-www/
if [ -d ../opensim-www/ ]; then
cd ../opensim-www/
svn update
chown -R www-data:www-data /var/opensim-www
service lighttpd restart
dialog --yesno "This option will update the Spectacled Owl's OpenSim website pages. These pages are the ones that you see when logging-in to the Spectacled Owl and allow the web-based management of the Spectacled Owl. If you have made changes to the pages located in /var/opensim-www, you should make a backup and say yes. Do you want to upgrade the Spectacled Owl website pages?" 10 70
if [ $? == "0"]; then
echo "[SpectacledOwl] Updating website..."
cp -R * /var/www/
chown -R www-data:www-data /var/opensim-www
service lighttpd restart
fi
fi
popd
echo "[SpectacledOwl] Deploying tools..."
if [ -x lib/osstrap ]; then
cp lib/osstrap /etc/init.d/osstrap
dialog --yesno "The Spectacled Owl uses a few shell scripts that manage the virtual machine. These tools can be found in the opensim-tools/lib directory and when you run this script they are updated and copied into the filesystem. A safe answer would be yes since they make-up for the core functionality of the Spectacled Owl. Do you want to deploy the Spectacled Owl tools?" 10 70
if [ $? == "0" ]; then
echo "[SpectacledOwl] Deploying tools..."
if [ -x lib/osstrap ]; then
cp lib/osstrap /etc/init.d/osstrap
fi
if [ -x lib/iardumper ]; then
cp lib/iardumper /etc/cron.daily/iardumper
fi
fi
if [ -x lib/iardumper ]; then
cp lib/iardumper /etc/cron.daily/iardumper
fi
echo "[SpectacledOwl] Applying firewall..."
if [ -x lib/firewall ]; then
dialog --yesno "Apply the latest firewall changes? The firewall rules can be found in the opensim-tools/lib/firewall file and consist of a rudiementary set of protections for the Spectacled Owl. If you have made changes to ports and are now managing the firewall by yourself, the safe choice is no. Otherwise, please select yes." 10 70
if [ -x lib/firewall ] && [ $? == "0" ]; then
echo "[SpectacledOwl] Applying firewall..."
lib/firewall
fi
echo "[SpectacledOwl] Restarting SpectacledOwl."