diff options
author | root | 2019-05-19 20:13:18 +1000 |
---|---|---|
committer | root | 2019-05-19 20:13:18 +1000 |
commit | 9caf08846ad3b8e64a6519b8678836e5374cb9b4 (patch) | |
tree | 3fb1b0aa3b7387df71f69a3e75bfcc049c31d22f | |
parent | Kill it with fire! (diff) | |
download | opensim-SC_OLD-9caf08846ad3b8e64a6519b8678836e5374cb9b4.zip opensim-SC_OLD-9caf08846ad3b8e64a6519b8678836e5374cb9b4.tar.gz opensim-SC_OLD-9caf08846ad3b8e64a6519b8678836e5374cb9b4.tar.bz2 opensim-SC_OLD-9caf08846ad3b8e64a6519b8678836e5374cb9b4.tar.xz |
Various script fixups.
Diffstat (limited to '')
-rwxr-xr-x | InstallItAll.sh | 7 | ||||
-rwxr-xr-x | scripts/start-sim | 26 |
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; | |||
65 | FLUSH PRIVILEGES; | 65 | FLUSH PRIVILEGES; |
66 | zzzzEOFzzz | 66 | zzzzEOFzzz |
67 | 67 | ||
68 | sudo adduser --system --shell /bin/bash --group $OS_USER | 68 | echo "Setting up OpenSim." |
69 | sudo adduser --system --shell /bin/false --group $OS_USER | ||
69 | sudo addgroup $USER $OS_USER | 70 | sudo addgroup $USER $OS_USER |
70 | 71 | ||
71 | echo "Building OpenSim." | 72 | echo "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 | ||
75 | echo "Setting up OpenSim." | 78 | echo "Setting up OpenSim." |
76 | sudo rm -fr $OSPATH/opensim-IG_* | 79 | sudo rm -fr $OSPATH/opensim-IG_* |
@@ -123,5 +126,5 @@ sudo chown $USER /home/$OS_USER/.tmux.conf | |||
123 | sudo chmod 644 /home/$OS_USER/.tmux.conf | 126 | sudo chmod 644 /home/$OS_USER/.tmux.conf |
124 | 127 | ||
125 | sudo scripts/fix_var_run.sh | 128 | sudo scripts/fix_var_run.sh |
126 | 129 | sudo cat scripts/opensim-crontab.txt | sudo crontab -u $OS_USER - | |
127 | echo "Done installing OpenSim." | 130 | echo "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') | |||
14 | quiet="" | 14 | quiet="" |
15 | inventory="" | 15 | inventory="" |
16 | 16 | ||
17 | function 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 | |||
17 | if [ $USER = "opensim" ] | 25 | if [ $USER = "opensim" ] |
18 | then | 26 | then |
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 |