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