These are the scripts currently run by hand on the old EC2 server to do a full upgrade (safe storeall handshake, backups, explode WAR, run the manager schema-migration tool, restart Tomcat). Committed as-is for now to review and refactor from, except tomcat_ctl.sh, which is already rewritten to control Tomcat via the new Docker container's supervisord (through the "service" shim) instead of the old host's /etc/init.d/tomcat8, since that service doesn't exist there. Kept as a drop-in replacement: the "status" output still contains both literal substrings upgrade.sh and restart.sh each grep for, so neither caller needed to change yet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tj4SF2BGFxgoRYrCAzNpDb
25 lines
676 B
Bash
25 lines
676 B
Bash
#!/bin/bash
|
|
function runcmd {
|
|
local __resultvar=$1
|
|
sfile="/home/sportrum/webapp/sportrum/WEB-INF/storage/status.storeall.$pid"
|
|
rm -f ${sfile}
|
|
printf "storeall $pid" > /home/sportrum/webapp/sportrum/WEB-INF/storage/commands.txt || exit 1
|
|
sfile="/home/sportrum/webapp/sportrum/WEB-INF/storage/status.storeall.$pid"
|
|
while [ ! -f $sfile ]
|
|
do
|
|
sleep 1
|
|
done
|
|
while true
|
|
do
|
|
status=$(cut -d " " -f 1 $sfile)
|
|
if [ "x$(echo $status | cut -d ':' -f 1)" == "xcompleted" ]
|
|
then
|
|
local funresult="$(echo $status | cut -d ':' -f 2)"
|
|
eval $__resultvar="'$funresult'"
|
|
break;
|
|
else
|
|
echo "$(cat $sfile)"
|
|
sleep 1
|
|
fi
|
|
done
|
|
}
|