#!/bin/bash cd /workspace # Spot Instance vs if dpkg-query -W libgl1 2>/dev/null | grep -q "libgl1"; then echo -n "" else echo "libgl1 is not installed. Installing..." apt update apt install -yq libgl1 fi python /workspace/SD/launch.py --port 7860 --api --theme dark --allow-code --enable-insecure-extension-access --listen --share --cuda-malloc --cuda-stream --pin-shared-memory kill $! kill -9 $(ps -ef | grep 'ngrok' | grep -v 'grep' | awk '{print $2}') deactivate echo "stopped"