diff options
Diffstat (limited to 'install_opensim.sh')
| -rwxr-xr-x | install_opensim.sh | 81 |
1 files changed, 48 insertions, 33 deletions
diff --git a/install_opensim.sh b/install_opensim.sh index 0800523..4163132 100755 --- a/install_opensim.sh +++ b/install_opensim.sh | |||
| @@ -6,6 +6,10 @@ then | |||
| 6 | else | 6 | else |
| 7 | MYSQL_PASSWORD=$1 | 7 | MYSQL_PASSWORD=$1 |
| 8 | fi | 8 | fi |
| 9 | REST_USER="RestingUser" | ||
| 10 | REST_PASSWORD="SecretRestingPlace" | ||
| 11 | |||
| 12 | OSPATH="/opt/opensim" | ||
| 9 | USER=$(whoami) | 13 | USER=$(whoami) |
| 10 | VERSION_CONTROL="off" | 14 | VERSION_CONTROL="off" |
| 11 | 15 | ||
| @@ -36,41 +40,33 @@ sudo chmod 757 /var/log/opensim | |||
| 36 | sudo mkdir -p /var/run/opensim | 40 | sudo mkdir -p /var/run/opensim |
| 37 | sudo chown opensim:opensim /var/run/opensim | 41 | sudo chown opensim:opensim /var/run/opensim |
| 38 | sudo chmod 757 /var/run/opensim | 42 | sudo chmod 757 /var/run/opensim |
| 39 | sudo mkdir -p /opt/opensim/config /opt/opensim/modules /opt/opensim/setup | 43 | sudo mkdir -p $OSPATH/config $OSPATH/setup $OSPATH/caches/assetcache |
| 40 | sudo chown opensim:opensim /opt/opensim | 44 | sudo chown opensim:opensim $OSPATH |
| 41 | sudo chown -R opensim:opensim /opt/opensim | 45 | sudo chown -R opensim:opensim $OSPATH |
| 42 | sudo chmod -R 757 /opt/opensim | 46 | sudo chmod -R 757 $OSPATH |
| 43 | cp start-sim-in-rest /opt/opensim/setup | 47 | cp * $OSPATH/setup |
| 44 | cp opensim-monit.conf /opt/opensim/setup | 48 | cp common.ini $OSPATH/config |
| 49 | sed -i "s@MYSQL_PASSWORD@$MYSQL_PASSWORD@g" $OSPATH/config/common.ini | ||
| 50 | sed -i "s@REST_PASSWORD@$REST_PASSWORD@g" $OSPATH/config/common.ini | ||
| 51 | sed -i "s@REST_USER@$REST_USER@g" $OSPATH/config/common.ini | ||
| 45 | cat opensim-crontab.txt | sudo crontab -u opensim - | 52 | cat opensim-crontab.txt | sudo crontab -u opensim - |
| 46 | 53 | ||
| 47 | cd /opt/opensim | 54 | cd $OSPATH |
| 48 | if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ] | 55 | if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ] |
| 49 | then | 56 | then |
| 50 | wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 | 57 | wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 |
| 51 | fi | 58 | fi |
| 52 | |||
| 53 | if [ ! -e opensim-0.7.1.1-infinitegrid-03 ] | 59 | if [ ! -e opensim-0.7.1.1-infinitegrid-03 ] |
| 54 | then | 60 | then |
| 55 | tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 | 61 | tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 |
| 56 | fi | 62 | fi |
| 57 | ln -fs opensim-0.7.1.1-infinitegrid-03 current | 63 | ln -fs opensim-0.7.1.1-infinitegrid-03 current |
| 58 | 64 | ||
| 59 | cd current/bin | 65 | # Create the REST client config file. |
| 60 | mv -f OpenSim.Forge.Currency.dll ../../modules/ | 66 | cat > config/OpenSim.ConsoleClient.ini << zzzzEOFzzzz |
| 61 | ln -fs ../../modules/OpenSim.Forge.Currency.dll OpenSim.Forge.Currency.dll | ||
| 62 | mv -f OpenSimSearch.Modules.dll ../../modules/ | ||
| 63 | ln -fs ../../modules/OpenSimSearch.Modules.dll OpenSimSearch.Modules.dll | ||
| 64 | mv -f NSLModules.Messaging.MuteList.dll ../../modules/ | ||
| 65 | ln -fs ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll | ||
| 66 | mv -f OpenSimProfile.Modules.dll ../../modules/ | ||
| 67 | ln -fs ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll | ||
| 68 | ln -fs ../../config config | ||
| 69 | |||
| 70 | cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz | ||
| 71 | [Startup] | 67 | [Startup] |
| 72 | ; Set here or use the -user command-line switch | 68 | ; Set here or use the -user command-line switch |
| 73 | user = RestingUser | 69 | user = $REST_USER |
| 74 | 70 | ||
| 75 | ; Set here or use the -host command-line switch | 71 | ; Set here or use the -host command-line switch |
| 76 | host = localhost | 72 | host = localhost |
| @@ -81,18 +77,37 @@ cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz | |||
| 81 | ; Set here or use the -pass command-line switch | 77 | ; Set here or use the -pass command-line switch |
| 82 | ; Please be aware that this is not secure since the password is in the clear | 78 | ; Please be aware that this is not secure since the password is in the clear |
| 83 | ; we recommend the use of -pass wherever possible | 79 | ; we recommend the use of -pass wherever possible |
| 84 | pass = SecretRestingPLace | 80 | pass = $REST_PASSWORD |
| 85 | zzzzEOFzzzz | 81 | zzzzEOFzzzz |
| 86 | 82 | ||
| 87 | sed -i 's@<appender name="LogFileAppender" type="log4net.Appender.FileAppender">@<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">@' OpenSim.exe.config | 83 | cd current/bin |
| 88 | sed -i 's@; ConsoleUser = "Test"@ConsoleUser = "RestingUser"@' OpenSim.ini | 84 | # Not sure why we are moving these. Hopefully we can get rid of having to move them. |
| 89 | sed -i 's@; ConsolePass = "secret"@ConsolePass = "SecretRestingPlace"@' OpenSim.ini | 85 | # Comenting them out, until Alice or Rizzy remember why they seed to be moved. See if things still work. |
| 86 | #mv -f OpenSim.Forge.Currency.dll ../../modules/ | ||
| 87 | #ln -fs ../../modules/OpenSim.Forge.Currency.dll OpenSim.Forge.Currency.dll | ||
| 88 | #mv -f OpenSimSearch.Modules.dll ../../modules/ | ||
| 89 | #ln -fs ../../modules/OpenSimSearch.Modules.dll OpenSimSearch.Modules.dll | ||
| 90 | #mv -f NSLModules.Messaging.MuteList.dll ../../modules/ | ||
| 91 | #ln -fs ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll | ||
| 92 | #mv -f OpenSimProfile.Modules.dll ../../modules/ | ||
| 93 | #ln -fs ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll | ||
| 94 | |||
| 95 | ln -fs ../../config config | ||
| 96 | mv -f addon-modules ../../config | ||
| 97 | ln -fs ../../config/addon-modules addon-modules | ||
| 98 | |||
| 99 | # Try to make the OS distro directory suited to being read only. | ||
| 100 | ln -fs ../../caches caches | ||
| 101 | mv -f ScriptEngines ../../caches | ||
| 102 | ln -fs ../../caches/ScriptEngines ScriptEngines | ||
| 103 | # Grumble, OS has it's own silly ideas, and recreates this. | ||
| 104 | # "Cannot create /opt/opensim/opensim-0.7.1.1-infinitegrid-03/bin/addin-db-001 because a file with the same name already exists." | ||
| 105 | #ln -fs ../../caches/addin-db-001 addin-db-001 | ||
| 90 | 106 | ||
| 91 | cd config-include/ | 107 | cd config-include/ |
| 108 | # Damn, can't overide these, we could change them for the next IG OS release. | ||
| 92 | sed -i 's@Include-Storage = "config-include/storage/SQLiteStandalone.ini";@; Include-Storage = "config-include/storage/SQLiteStandalone.ini";@' GridCommon.ini | 109 | sed -i 's@Include-Storage = "config-include/storage/SQLiteStandalone.ini";@; Include-Storage = "config-include/storage/SQLiteStandalone.ini";@' GridCommon.ini |
| 93 | sed -i 's@; StorageProvider = "OpenSim.Data.MySQL.dll"@StorageProvider = "OpenSim.Data.MySQL.dll"@' GridCommon.ini | 110 | sed -i 's@CacheDirectory = ./assetcache@CacheDirectory = caches/assetcache@' FlotsamCache.ini |
| 94 | 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 | ||
| 95 | |||
| 96 | cd ../../.. | 111 | cd ../../.. |
| 97 | 112 | ||
| 98 | # Setting screen to be suid. EWWWWWW!!! Security hole!! | 113 | # Setting screen to be suid. EWWWWWW!!! Security hole!! |
| @@ -105,9 +120,9 @@ then | |||
| 105 | sudo chown root:utmp /var/run/screen | 120 | sudo chown root:utmp /var/run/screen |
| 106 | fi | 121 | fi |
| 107 | 122 | ||
| 108 | sudo chown -R opensim:opensim /opt/opensim | 123 | sudo chown -R opensim:opensim $OSPATH |
| 109 | sudo chmod -R a-x /opt/opensim | 124 | sudo chmod -R a-x $OSPATH |
| 110 | sudo chmod -R a+X /opt/opensim | 125 | sudo chmod -R a+X $OSPATH |
| 111 | sudo chmod -R g+w /opt/opensim | 126 | sudo chmod -R g+w $OSPATH |
| 112 | sudo chmod a+x /opt/opensim/setup/start-sim-in-rest | 127 | sudo chmod a+x $OSPATH/setup/start-sim |
| 113 | 128 | ||
