opensim-tools – Blame information for rev 52

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 eva 1 #!/bin/bash
2 ###########################################################################
3 ## Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 ##
4 ## Please see: http://www.gnu.org/licenses/gpl.html for legal details, ##
5 ## rights of fair usage, the disclaimer and warranty conditions. ##
6 ###########################################################################
7  
42 eva 8 PATH=/opt/mono-4-0/bin:$PATH
9  
28 eva 10 dialog --msgbox "This tool will upgrade the Spectacled Owl machine." 10 70
48 eva 11  
12 # Spectaced Owl upgrade
13 if [ -f lib/install-packages.txt ] && [ -f lib/uninstall-packages.txt ]; then
14 dialog --yesno "By selecting yes here, the Spectacled Owl will install or remove packages essential for OpenSim from the virtual machine. You should say yes here unless you have made major changes to the Spectacled Owl machine. Would you like to process the list of packages to install or remove?" 10 70
15 if [ $? == "0" ]; then
16 # Update repositories
17 aptitude update
18 aptitude upgrade
19 # Remove packages
20 cat lib/uninstall-packages.txt | while read p; do
50 eva 21 PACKAGE=`dpkg -l | grep "$p" | head -1 | awk '{ print $2 }'`
49 eva 22 if [ "$PACKAGE" == "$p" ]; then
48 eva 23 aptitude purge $p
24 fi
25 done
26 # Install packages
27 cat lib/install-packages.txt | while read i; do
50 eva 28 PACKAGE=`dpkg -l | grep "$i" | head -1 | awk '{ print $2 }'`
49 eva 29 if [ "$PACKAGE" != "$i" ]; then
48 eva 30 aptitude install $i
31 fi
32 done
33 fi
34 fi
35  
52 eva 36 # Update system files
37 dialog --yesno "This part of the upgrade process updates the Spectacled Owl system files with updated versions from the official repository. Unless you have heavily modified the Spectacled Owl machine, you should say yes here. Would you like to update the Spectacled Owl system files?" 10 70
38 if [ $? == "0" ]; then
39 cp -Rap fs/* /
40 fi
41  
48 eva 42 # OpenSim upgrade
20 eva 43 pushd ./
28 eva 44 if [ -d ../opensim-sources/ ]; then
20 eva 45 cd ../opensim-sources/
46 echo "[SpectacledOwl] Updating sources..."
47 svn update
48 eva 48 dialog --yesno "By selecting 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
30 eva 49 if [ $? == "0" ]; then
28 eva 50 echo "[SpectacledOwl] Cleaning..."
51 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make clean
52 echo "[SpectacledOwl] Build..."
53 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make
54 if [ -d /home/opensim/os ]; then
30 eva 55 echo "[SpectacledOwl] Copying files..."
56 mkdir -p /home/opensim/os
57 find bin/ -name \*.ini -exec rm -rf '{}' \;
58 find bin/ -name \*.config -exec rm -rf '{}' \;
59 cp -Ra bin/* /home/opensim/os/
60 echo "[SpectacledOwl] Changing ownership..."
61 chown -R opensim:opensim /home/opensim/os/
62 fi
20 eva 63 fi
64 fi
28 eva 65 if [ -d ../opensim-config/ ]; then
20 eva 66 cd ../opensim-config/
67 svn update
33 eva 68 dialog --yesno "This option will update OpenSim's configuration files EXCEPT Regions.ini which will not be overwritten. 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?" 12 70
28 eva 69 if [ $? == "0" ]; then
70 echo "[SpectacledOwl] Updating configuration..."
71 cp -Ra * /home/opensim/os/
72 fi
20 eva 73 fi
28 eva 74 if [ -d ../opensim-www/ ]; then
75 cd ../opensim-www/
20 eva 76 svn update
34 eva 77 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/www, you should make a backup and say yes. Do you want to upgrade the Spectacled Owl website pages?" 10 70
29 eva 78 if [ $? == "0" ]; then
28 eva 79 echo "[SpectacledOwl] Updating website..."
80 cp -R * /var/www/
34 eva 81 chown -R www-data:www-data /var/www
28 eva 82 service lighttpd restart
83 fi
20 eva 84 fi
85 popd
28 eva 86 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
87 if [ $? == "0" ]; then
88 echo "[SpectacledOwl] Deploying tools..."
89 if [ -x lib/osstrap ]; then
90 cp lib/osstrap /etc/init.d/osstrap
91 fi
92 if [ -x lib/iardumper ]; then
93 cp lib/iardumper /etc/cron.daily/iardumper
94 fi
20 eva 95 fi
29 eva 96 if [ -x lib/firewall ]; then
97 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
98 if [ $? == "0" ]; then
99 echo "[SpectacledOwl] Applying firewall..."
100 lib/firewall
101 fi
20 eva 102 fi
32 eva 103 dialog --yesno "It is recommended to restart the OpenSim instance now. You can switch to the first console using CTRL+ALT+F1 and restart OpenSim yourself, or answer yes here. Restart OpenSim?" 10 70
104 if [ $? == "0" ]; then
105 echo "[SpectacledOwl] Restarting OpenSim."
106 kill -s HUP `pidof mono`
107 fi
20 eva 108 echo "[SpectacledOwl] Done."
32 eva 109 dialog --msgbox "Upgrade process is now complete. Have a nice day." 10 70