diff options
author | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
---|---|---|
committer | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
commit | ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f (patch) | |
tree | b25d5ce40da4019db2b7f1552eda19d91677365c /install_opensim.sh | |
download | IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.zip IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.gz IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.bz2 IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.xz |
First commit.
Diffstat (limited to '')
-rwxr-xr-x | install_opensim.sh | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/install_opensim.sh b/install_opensim.sh new file mode 100755 index 0000000..0c8c659 --- /dev/null +++ b/install_opensim.sh | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | if [ x$1 = x ] | ||
4 | then | ||
5 | MYSQL_PASSWORD="OpenSimSucks" | ||
6 | else | ||
7 | MYSQL_PASSWORD=$1 | ||
8 | fi | ||
9 | USER=$(whoami) | ||
10 | |||
11 | sudo apt-get install mysql-server screen mono-complete monit mc | ||
12 | sudo /etc/init.d/mysql restart | ||
13 | |||
14 | echo "Setting up mySQL" | ||
15 | mysql -u root -p -h localhost << zzzzEOFzzz | ||
16 | drop database 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'; | ||
22 | create user 'opensim'@'localhost' identified by '$MYSQL_PASSWORD'; | ||
23 | grant all on opensim.* to opensim; | ||
24 | grant all on opensim.* to 'opensim'@'localhost'; | ||
25 | FLUSH PRIVILEGES; | ||
26 | zzzzEOFzzz | ||
27 | |||
28 | echo "Setting up OpenSim" | ||
29 | sudo deluser opensim | ||
30 | sudo adduser --system --shell /bin/false --group opensim | ||
31 | sudo mkdir -p /var/log/opensim | ||
32 | sudo chown opensim:opensim /var/log/opensim | ||
33 | sudo chmod 777 /var/log/opensim | ||
34 | sudo mkdir -p /var/run/opensim | ||
35 | sudo chown opensim:opensim /var/run/opensim | ||
36 | sudo chmod 777 /var/run/opensim | ||
37 | sudo mkdir -p /opt/opensim | ||
38 | sudo chown $USER:$USER /opt/opensim | ||
39 | |||
40 | cd /opt/opensim | ||
41 | wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 | ||
42 | tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 | ||
43 | ln -s opensim-0.7.1.1-infinitegrid-03 current | ||
44 | mkdir -p config | ||
45 | mkdir -p modules | ||
46 | mkdir -p setup | ||
47 | cp setup/opensim-crontab.txt config | ||
48 | cat setup/opensim-crontab.txt | sudo crontab -u opensim - | ||
49 | |||
50 | cd current/bin | ||
51 | mv OpenSim.Forge.Currency.dll ../../modules/ | ||
52 | ln -s ../../modules/OpenSim.Forge.Currency.dll OpenSim.Forge.Currency.dll | ||
53 | mv OpenSimSearch.Modules.dll ../../modules/ | ||
54 | ln -s ../../modules/OpenSimSearch.Modules.dll OpenSimSearch.Modules.dll | ||
55 | mv NSLModules.Messaging.MuteList.dll ../../modules/ | ||
56 | ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll | ||
57 | mv OpenSimProfile.Modules.dll ../../modules/ | ||
58 | ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll | ||
59 | #sudo chown -R opensim:opensim ../../modules | ||
60 | ln -s ../../config config | ||
61 | |||
62 | cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz | ||
63 | [Startup] | ||
64 | ; Set here or use the -user command-line switch | ||
65 | user = RestingUser | ||
66 | |||
67 | ; Set here or use the -host command-line switch | ||
68 | host = localhost | ||
69 | |||
70 | ; Set here or use the -port command-line switch | ||
71 | ; port = 9002 | ||
72 | |||
73 | ; Set here or use the -pass command-line switch | ||
74 | ; Please be aware that this is not secure since the password is in the clear | ||
75 | ; we recommend the use of -pass wherever possible | ||
76 | pass = SecretRestingPLace | ||
77 | zzzzEOFzzzz | ||
78 | |||
79 | sed -i 's@<appender name="LogFileAppender" type="log4net.Appender.FileAppender">@<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">@' OpenSim.exe.config | ||
80 | sed -i 's@; ConsoleUser = "Test"@ConsoleUser = "RestingUser"@' OpenSim.ini | ||
81 | sed -i 's@; ConsolePass = "secret"@ConsolePass = "SecretRestingPlace"@' OpenSim.ini | ||
82 | |||
83 | cd config-include/ | ||
84 | sed -i 's@Include-Storage = "config-include/storage/SQLiteStandalone.ini";@; Include-Storage = "config-include/storage/SQLiteStandalone.ini";@' GridCommon.ini | ||
85 | sed -i 's@; StorageProvider = "OpenSim.Data.MySQL.dll"@StorageProvider = "OpenSim.Data.MySQL.dll"@' GridCommon.ini | ||
86 | sed -i "s@; ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=\*\*\*\*;\"@ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=$MYSQL_PASSWORD;\"@" GridCommon.ini | ||
87 | |||
88 | cd ../../.. | ||
89 | #sudo chown -R opensim:opensim opensim-0.7.1.1-infinitegrid-03 | ||
90 | |||