adding process killer

This commit is contained in:
Darrel Pol 2024-09-12 21:39:38 -05:00
parent df097918f3
commit b4bce19f34

View file

@ -24,6 +24,16 @@ jobs:
ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=60 -o StrictHostKeyChecking=no ${{ secrets.MOONLITE_AWS_EC2_SSH_USER }}@${{ secrets.MOONLITE_AWS_EC2_SSH_HOST }} << 'EOF'
cd /home/ec2-user/apps
# Kill any existing process of launch.py if running
echo "Checking for existing launch.py process..."
PID=\$(pgrep -f launch.py)
if [ -n "\$PID" ]; then
echo "Found running process for launch.py. Terminating PID \$PID..."
kill -9 \$PID
else
echo "No running process found for launch.py."
fi
# Check if the stable-diffusion-webui folder exists
if [ ! -d "stable-diffusion-webui" ]; then
echo "Cloning stable-diffusion-webui from GitHub..."