aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xInstallItAll.sh7
-rwxr-xr-xscripts/start-sim26
2 files changed, 24 insertions, 9 deletions
diff --git a/InstallItAll.sh b/InstallItAll.sh
index 1efd0f5..81ff54f 100755
--- a/InstallItAll.sh
+++ b/InstallItAll.sh
@@ -65,12 +65,15 @@ grant all on $MYSQL_DB.* to $OS_USER@localhost;
65FLUSH PRIVILEGES; 65FLUSH PRIVILEGES;
66zzzzEOFzzz 66zzzzEOFzzz
67 67
68sudo adduser --system --shell /bin/bash --group $OS_USER 68echo "Setting up OpenSim."
69sudo adduser --system --shell /bin/false --group $OS_USER
69sudo addgroup $USER $OS_USER 70sudo addgroup $USER $OS_USER
70 71
71echo "Building OpenSim." 72echo "Building OpenSim."
72./runprebuild.sh 73./runprebuild.sh
73./nant-color 74./nant-color
75#xbuild /target:clean
76#xbuild /p:TargetFrameworkVersion="v4.5"
74 77
75echo "Setting up OpenSim." 78echo "Setting up OpenSim."
76sudo rm -fr $OSPATH/opensim-IG_* 79sudo rm -fr $OSPATH/opensim-IG_*
@@ -123,5 +126,5 @@ sudo chown $USER /home/$OS_USER/.tmux.conf
123sudo chmod 644 /home/$OS_USER/.tmux.conf 126sudo chmod 644 /home/$OS_USER/.tmux.conf
124 127
125sudo scripts/fix_var_run.sh 128sudo scripts/fix_var_run.sh
126 129sudo cat scripts/opensim-crontab.txt | sudo crontab -u $OS_USER -
127echo "Done installing OpenSim." 130echo "Done installing OpenSim."
diff --git a/scripts/start-sim b/scripts/start-sim
index 86cc90d..bd0815f 100755
--- a/scripts/start-sim
+++ b/scripts/start-sim
@@ -14,6 +14,14 @@ date=$(date '+%F_%T')
14quiet="" 14quiet=""
15inventory="" 15inventory=""
16 16
17function wait_for_text()
18{
19 while :; do
20 sleep 10
21 ${tmux_command} capture-pane -t ${tmux_session}:"${1}" -p | grep -E "${2}" 2>&1 > /dev/null && return
22 done
23}
24
17if [ $USER = "opensim" ] 25if [ $USER = "opensim" ]
18then 26then
19 SUDO="" 27 SUDO=""
@@ -99,6 +107,8 @@ case $(basename $0) in
99 ${tmux_window} \; attach-session -t "${tmux_session}" 107 ${tmux_window} \; attach-session -t "${tmux_session}"
100 fi 108 fi
101 fi 109 fi
110
111 ${tmux_send}:"${title}" Enter Enter Enter
102 ;; 112 ;;
103 113
104 "backup-inventory") 114 "backup-inventory")
@@ -109,17 +119,19 @@ case $(basename $0) in
109 cmd="save iar -c ${inventory} / password ${PRGDIR}/../../backups/${user}-${date}.iar" 119 cmd="save iar -c ${inventory} / password ${PRGDIR}/../../backups/${user}-${date}.iar"
110 # Do it in the highest numbered window. 120 # Do it in the highest numbered window.
111 ${tmux_send}:"$" "${cmd}" Enter 121 ${tmux_send}:"$" "${cmd}" Enter
112 ${tmux_send}:"$" "force gc" Enter 122 wait_for_text "$" "Saved archive with [[:digit:]]+ items for ${user/_/ }"
123 ${tmux_send}:"$" "force gc" Enter Enter Enter
113 ;; 124 ;;
114 125
115 "backup-sim") 126 "backup-sim")
116 cd ${PRGDIR}
117 $SUDO ${PRGDIR}/gitAR.sh o "${title}"
118 sim=$(sanitize "${title}")
119 # Add the full date and time to create the OAR file name.
120 cmd="save oar --all ${PRGDIR}/../../backups/${sim}-${date}.oar"
121 if [ -e /var/run/opensim/${tgt}.pid ]; then 127 if [ -e /var/run/opensim/${tgt}.pid ]; then
122 ${tmux_send}:"[${title}]" "${cmd}" Enter 128 cd ${PRGDIR}
129 $SUDO ${PRGDIR}/gitAR.sh o "${title}"
130 sim=$(sanitize "${title}")
131 # Add the full date and time to create the OAR file name.
132 cmd="save oar --all ${PRGDIR}/../../backups/${sim}-${date}.oar"
133 ${tmux_send}:"${title}" "${cmd}" Enter
134 wait_for_text "${title}" "Finished writing out OAR for ${title}"
123 # Generate the map tiles, coz the good generator leaks memory badly if you leave it turned on. 135 # Generate the map tiles, coz the good generator leaks memory badly if you leave it turned on.
124 ${tmux_send}:"${title}" "generate map" Enter 136 ${tmux_send}:"${title}" "generate map" Enter
125 ${tmux_send}:"${title}" "force gc" Enter Enter Enter 137 ${tmux_send}:"${title}" "force gc" Enter Enter Enter