-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
25 lines (19 loc) · 787 Bytes
/
run.sh
File metadata and controls
25 lines (19 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Check if the `infovis23_session` session is already running
if screen -ls | grep -q "infovis23_session"; then
# If it is, kill the session
screen -X -S infovis23_session quit
echo "Existing session killed."
fi
# Start a new `screen` session with the name "infovis23_session"
screen -S infovis23_session -d -m
# Attach to the `infovis23_session` session and run the `uvicorn` command
screen -r infovis23_session -X stuff 'cd /root/Apps/InfoViz23/server/ && uvicorn server:app --reload --host 0.0.0.0 --port 8085'
# Detach from the `infovis23_session` session
screen -d infovis23_session
# Wait for the `uvicorn` process to finish
# while [ -n "$(ps -ef | grep uvicorn | grep -v grep)" ]; do
# sleep 1
# done
# Print "Server is up"
echo "Server is up."