mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-15 18:02:49 +00:00
20 lines
431 B
Bash
20 lines
431 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
start_server () {
|
||
|
echo "Starting HTTP Server on port 8000..."
|
||
|
python3 -m http.server --directory ./out > /dev/null &
|
||
|
PID=$!
|
||
|
echo $PID > ./out/file_server_pid
|
||
|
sleep 1
|
||
|
}
|
||
|
|
||
|
if [ -f ./out/file_server_pid ]; then
|
||
|
PID=$(cat ./out/file_server_pid)
|
||
|
if ps -p $PID > /dev/null; then
|
||
|
echo "HTTP Server appears to already be running"
|
||
|
else
|
||
|
start_server
|
||
|
fi
|
||
|
else
|
||
|
start_server
|
||
|
fi
|