opensim-tools – Rev 27

Subversion Repositories:
Rev:
#!/bin/bash
###########################################################################
##  Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3      ##
##  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  ##
##  rights of fair usage, the disclaimer and warranty conditions.        ##
###########################################################################

pushd ./
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 
                echo "[SpectacledOwl] Copying files..."
                mkdir -p /home/opensim/os
                find bin/ -name \*.ini -exec rm -rf '{}' \;
                find bin/ -name \*.config -exec rm -rf '{}' \;
                cp -Ra bin/* /home/opensim/os/
                echo "[SpectacledOwl] Changing ownership..."
                chown -R opensim:opensim /home/opensim/os/
        fi
fi
if [ -d ../opensim-config ]; then
        echo "[SpectacledOwl] Updating configuration..."
        cd ../opensim-config/
        svn update
        cp -Ra * /home/opensim/os/
fi
if [ -d /var/opensim-www ]; then
        echo "[SpectacledOwl] Updating website..."
        cd /var/opensim-www/
        svn update
        chown -R www-data:www-data /var/opensim-www
        service lighttpd restart
fi
popd
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
echo "[SpectacledOwl] Applying firewall..."
if [ -x lib/firewall ]; then
        lib/firewall
fi
echo "[SpectacledOwl] Restarting SpectacledOwl."
kill -s HUP `pidof mono`
echo "[SpectacledOwl] Done."