diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..dcf7cdb --- /dev/null +++ b/run.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd /home/dsyoon/workspace/news_link + +PORT="${PORT:-8021}" + +if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then + echo "Stopping existing server on port ${PORT}..." + lsof -ti tcp:"${PORT}" | xargs -r kill -9 + sleep 1 +fi + +nohup /home/dsyoon/workspace/miniconda3/envs/ncue/bin/python app.py > nohup.out > 2>&1 &