Mercurial Hosting > luan
comparison host/start.sh @ 2029:5fa5a7efc936
merge
| author | Violet7 |
|---|---|
| date | Thu, 30 Oct 2025 21:25:37 -0700 |
| parents | fa8304b060d9 |
| children |
comparison
equal
deleted
inserted
replaced
| 2028:2f43f84191c9 | 2029:5fa5a7efc936 |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | |
| 3 set -e | 2 set -e |
| 4 | |
| 5 #seconds to wait | |
| 6 toWait=10; | |
| 7 i=0; | |
| 8 | 3 |
| 9 . check_app.sh; | 4 . check_app.sh; |
| 10 checkStopped; | 5 checkStopped; |
| 11 | 6 |
| 12 . luan string:; | 7 . luan string:; |
| 14 mkdir -p logs 2>/dev/null; | 9 mkdir -p logs 2>/dev/null; |
| 15 | 10 |
| 16 touch started.lock; | 11 touch started.lock; |
| 17 sudo $(which nginx) -c $(pwd)/local/nginx.conf; | 12 sudo $(which nginx) -c $(pwd)/local/nginx.conf; |
| 18 if [ "$1" == "launchd" ]; then | 13 if [ "$1" == "launchd" ]; then |
| 19 java -Xms1024M -classpath $CLASSPATH luan.Luan run.luan logs 1>logs/stdout.log 2>logs/stderr.log | 14 java -Xms1024M -classpath $CLASSPATH luan.Luan run_host.luan logs 1>logs/stdout.log 2>logs/stderr.log |
| 20 else | 15 else |
| 21 java -Xms1024M -classpath $CLASSPATH luan.Luan run.luan logs 1>logs/stdout.log 2>logs/stderr.log & | 16 java -Xms1024M -classpath $CLASSPATH luan.Luan run_host.luan logs 1>logs/stdout.log 2>logs/stderr.log & |
| 22 | 17 |
| 23 getPids; | 18 getPids; |
| 24 if [ "$PIDS" == "" ]; then | 19 if [ "$PIDS" == "" ]; then |
| 20 #seconds to wait | |
| 21 toWait=10; | |
| 22 i=0; | |
| 25 while [ $i -lt $toWait ]; do | 23 while [ $i -lt $toWait ]; do |
| 26 sleep 1; | 24 sleep 1; |
| 27 getPids; | 25 getPids; |
| 28 if [ "$PIDS" != "" ]; then | 26 if [ "$PIDS" != "" ]; then |
| 29 break | 27 break |
