aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2011-11-26 16:13:33 +1000
committerDavid Walter Seikel2011-11-26 16:13:33 +1000
commitf0739ac23cef519d2ac1e7dcb3b0ca98c331c2b3 (patch)
treeac4bff7525423d687eac2c34d6455be1cfb9793a
parentIssue some warnings. Figure out the IP using a web service. Clean ups. (diff)
downloadIGnoble-f0739ac23cef519d2ac1e7dcb3b0ca98c331c2b3.zip
IGnoble-f0739ac23cef519d2ac1e7dcb3b0ca98c331c2b3.tar.gz
IGnoble-f0739ac23cef519d2ac1e7dcb3b0ca98c331c2b3.tar.bz2
IGnoble-f0739ac23cef519d2ac1e7dcb3b0ca98c331c2b3.tar.xz
Make it safe.
-rwxr-xr-xinstall_opensim.sh61
1 files changed, 32 insertions, 29 deletions
diff --git a/install_opensim.sh b/install_opensim.sh
index 14d7c42..47ce76f 100755
--- a/install_opensim.sh
+++ b/install_opensim.sh
@@ -7,17 +7,14 @@ else
7 MYSQL_PASSWORD=$1 7 MYSQL_PASSWORD=$1
8fi 8fi
9USER=$(whoami) 9USER=$(whoami)
10VERSION_CONTROL="off"
10 11
11sudo apt-get install mysql-server screen mono-complete monit mc 12sudo apt-get install mysql-server screen mono-complete monit mc
12sudo /etc/init.d/mysql restart 13sudo /etc/init.d/mysql restart
13 14
14echo "Setting up mySQL" 15echo "Setting up mySQL"
15mysql -u root -p -h localhost << zzzzEOFzzz 16mysql -u root -p -h localhost << zzzzEOFzzz
16drop database opensim; 17create database if not exists opensim;
17create database opensim;
18drop user opensim;
19drop user 'opensim'@'localhost';
20FLUSH PRIVILEGES;
21create user opensim identified by '$MYSQL_PASSWORD'; 18create user opensim identified by '$MYSQL_PASSWORD';
22create user 'opensim'@'localhost' identified by '$MYSQL_PASSWORD'; 19create user 'opensim'@'localhost' identified by '$MYSQL_PASSWORD';
23grant all on opensim.* to opensim; 20grant all on opensim.* to opensim;
@@ -26,42 +23,46 @@ FLUSH PRIVILEGES;
26zzzzEOFzzz 23zzzzEOFzzz
27 24
28echo "Setting up OpenSim" 25echo "Setting up OpenSim"
29sudo deluser opensim --remove-home
30sudo adduser --system --shell /bin/false --group opensim 26sudo adduser --system --shell /bin/false --group opensim
27sudo addgroup $USER opensim
31sudo cp opensim.screenrc /home/opensim/.screenrc 28sudo cp opensim.screenrc /home/opensim/.screenrc
32sudo chmod 744 /home/opensim/.screenrc 29sudo chmod 644 /home/opensim/.screenrc
33sudo mkdir -p /var/log/opensim 30sudo mkdir -p /var/log/opensim
34sudo chown opensim:opensim /var/log/opensim 31sudo chown opensim:opensim /var/log/opensim
35sudo chmod 777 /var/log/opensim 32sudo chmod 757 /var/log/opensim
36sudo mkdir -p /var/run/opensim 33sudo mkdir -p /var/run/opensim
37sudo chown opensim:opensim /var/run/opensim 34sudo chown opensim:opensim /var/run/opensim
38sudo chmod 777 /var/run/opensim 35sudo chmod 757 /var/run/opensim
39sudo mkdir -p /opt/opensim 36sudo mkdir -p /opt/opensim/config /opt/opensim/modules /opt/opensim/setup
40sudo chown $USER:$USER /opt/opensim 37sudo chown opensim:opensim /opt/opensim
38sudo chown -R opensim:opensim /opt/opensim
39sudo chmod -R 757 /opt/opensim
40cp start-sim-in-rest /opt/opensim/setup
41cp opensim-monit.conf /opt/opensim/setup
42cat opensim-crontab.txt | sudo crontab -u opensim -
41 43
42cd /opt/opensim 44cd /opt/opensim
43if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ] 45if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ]
44then 46then
45 wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 47 wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2
46fi 48fi
47tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 49
48ln -s opensim-0.7.1.1-infinitegrid-03 current 50if [ ! -e opensim-0.7.1.1-infinitegrid-03 ]
49mkdir -p config 51then
50mkdir -p modules 52 tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2
51mkdir -p setup 53fi
52cp setup/opensim-crontab.txt config 54ln -fs opensim-0.7.1.1-infinitegrid-03 current
53cat setup/opensim-crontab.txt | sudo crontab -u opensim -
54 55
55cd current/bin 56cd current/bin
56mv OpenSim.Forge.Currency.dll ../../modules/ 57mv -f OpenSim.Forge.Currency.dll ../../modules/
57ln -s ../../modules/OpenSim.Forge.Currency.dll OpenSim.Forge.Currency.dll 58ln -fs ../../modules/OpenSim.Forge.Currency.dll OpenSim.Forge.Currency.dll
58mv OpenSimSearch.Modules.dll ../../modules/ 59mv -f OpenSimSearch.Modules.dll ../../modules/
59ln -s ../../modules/OpenSimSearch.Modules.dll OpenSimSearch.Modules.dll 60ln -fs ../../modules/OpenSimSearch.Modules.dll OpenSimSearch.Modules.dll
60mv NSLModules.Messaging.MuteList.dll ../../modules/ 61mv -f NSLModules.Messaging.MuteList.dll ../../modules/
61ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll 62ln -fs ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll
62mv OpenSimProfile.Modules.dll ../../modules/ 63mv -f OpenSimProfile.Modules.dll ../../modules/
63ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll 64ln -fs ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll
64ln -s ../../config config 65ln -fs ../../config config
65 66
66cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz 67cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz
67[Startup] 68[Startup]
@@ -101,6 +102,8 @@ then
101 sudo chown root:utmp /var/run/screen 102 sudo chown root:utmp /var/run/screen
102fi 103fi
103 104
104#sudo chown -R opensim:opensim opensim-0.7.1.1-infinitegrid-03 105sudo chown -R opensim:opensim /opt/opensim
105#sudo chown -R opensim:opensim modules 106sudo chmod -R a-x *
107sudo chmod -R a+X *
108sudo chmod a+x /opt/opensim/setup/start-sim-in-rest
106 109