opensim-tools – Diff between revs 31 and 32

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 31 Rev 32
1 #!/bin/bash 1 #!/bin/bash
2 ########################################################################### 2 ###########################################################################
3 ## Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 ## 3 ## Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 ##
4 ## Please see: http://www.gnu.org/licenses/gpl.html for legal details, ## 4 ## Please see: http://www.gnu.org/licenses/gpl.html for legal details, ##
5 ## rights of fair usage, the disclaimer and warranty conditions. ## 5 ## rights of fair usage, the disclaimer and warranty conditions. ##
6 ########################################################################### 6 ###########################################################################
7   7  
8 dialog --msgbox "This tool will upgrade the Spectacled Owl machine." 10 70 8 dialog --msgbox "This tool will upgrade the Spectacled Owl machine." 10 70
9 pushd ./ 9 pushd ./
10 if [ -d ../opensim-sources/ ]; then 10 if [ -d ../opensim-sources/ ]; then
11 cd ../opensim-sources/ 11 cd ../opensim-sources/
12 echo "[SpectacledOwl] Updating sources..." 12 echo "[SpectacledOwl] Updating sources..."
13 svn update 13 svn update
14 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 14 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
15 if [ $? == "0" ]; then 15 if [ $? == "0" ]; then
16 echo "[SpectacledOwl] Cleaning..." 16 echo "[SpectacledOwl] Cleaning..."
17 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make clean 17 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make clean
18 echo "[SpectacledOwl] Build..." 18 echo "[SpectacledOwl] Build..."
19 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make 19 PKG_CONFIG_PATH=/opt/mono-4-0/lib/pkgconfig make
20 if [ -d /home/opensim/os ]; then 20 if [ -d /home/opensim/os ]; then
21 echo "[SpectacledOwl] Copying files..." 21 echo "[SpectacledOwl] Copying files..."
22 mkdir -p /home/opensim/os 22 mkdir -p /home/opensim/os
23 find bin/ -name \*.ini -exec rm -rf '{}' \; 23 find bin/ -name \*.ini -exec rm -rf '{}' \;
24 find bin/ -name \*.config -exec rm -rf '{}' \; 24 find bin/ -name \*.config -exec rm -rf '{}' \;
25 cp -Ra bin/* /home/opensim/os/ 25 cp -Ra bin/* /home/opensim/os/
26 echo "[SpectacledOwl] Changing ownership..." 26 echo "[SpectacledOwl] Changing ownership..."
27 chown -R opensim:opensim /home/opensim/os/ 27 chown -R opensim:opensim /home/opensim/os/
28 fi 28 fi
29 fi 29 fi
30 fi 30 fi
31 if [ -d ../opensim-config/ ]; then 31 if [ -d ../opensim-config/ ]; then
32 cd ../opensim-config/ 32 cd ../opensim-config/
33 svn update 33 svn update
34 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 34 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
35 if [ $? == "0" ]; then 35 if [ $? == "0" ]; then
36 echo "[SpectacledOwl] Updating configuration..." 36 echo "[SpectacledOwl] Updating configuration..."
37 cp -Ra * /home/opensim/os/ 37 cp -Ra * /home/opensim/os/
38 fi 38 fi
39 fi 39 fi
40 if [ -d ../opensim-www/ ]; then 40 if [ -d ../opensim-www/ ]; then
41 cd ../opensim-www/ 41 cd ../opensim-www/
42 svn update 42 svn update
43 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?" 12 70 43 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?" 12 70
44 if [ $? == "0" ]; then 44 if [ $? == "0" ]; then
45 echo "[SpectacledOwl] Updating website..." 45 echo "[SpectacledOwl] Updating website..."
46 cp -R * /var/www/ 46 cp -R * /var/www/
47 chown -R www-data:www-data /var/opensim-www 47 chown -R www-data:www-data /var/opensim-www
48 service lighttpd restart 48 service lighttpd restart
49 fi 49 fi
50 fi 50 fi
51 popd 51 popd
52 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 52 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
53 if [ $? == "0" ]; then 53 if [ $? == "0" ]; then
54 echo "[SpectacledOwl] Deploying tools..." 54 echo "[SpectacledOwl] Deploying tools..."
55 if [ -x lib/osstrap ]; then 55 if [ -x lib/osstrap ]; then
56 cp lib/osstrap /etc/init.d/osstrap 56 cp lib/osstrap /etc/init.d/osstrap
57 fi 57 fi
58 if [ -x lib/iardumper ]; then 58 if [ -x lib/iardumper ]; then
59 cp lib/iardumper /etc/cron.daily/iardumper 59 cp lib/iardumper /etc/cron.daily/iardumper
60 fi 60 fi
61 fi 61 fi
62 if [ -x lib/firewall ]; then 62 if [ -x lib/firewall ]; then
63 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 63 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
64 if [ $? == "0" ]; then 64 if [ $? == "0" ]; then
65 echo "[SpectacledOwl] Applying firewall..." 65 echo "[SpectacledOwl] Applying firewall..."
66 lib/firewall 66 lib/firewall
67 fi 67 fi
68 fi 68 fi
-   69 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
-   70 if [ $? == "0" ]; then
69 echo "[SpectacledOwl] Restarting SpectacledOwl." 71 echo "[SpectacledOwl] Restarting OpenSim."
70 kill -s HUP `pidof mono` 72 kill -s HUP `pidof mono`
-   73 fi
71 echo "[SpectacledOwl] Done." 74 echo "[SpectacledOwl] Done."
-   75 dialog --msgbox "Upgrade process is now complete. Have a nice day." 10 70
72   76