view host/start.sh @ 1695:25833dd89844

add backup/update.sh
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 20 Jun 2022 16:37:23 -0600
parents 665049cffc02
children
line wrap: on
line source

#!/bin/bash

set -e

#seconds to wait
toWait=10;
i=0;

. check_app.sh;
checkStopped;

. luan string:;

mkdir -p logs 2>/dev/null;

touch started.lock;
sudo $(which nginx) -c $(pwd)/local/nginx.conf;
if [ "$1" == "launchd" ]; then
  java -Xms1024M -classpath $CLASSPATH luan.Luan run.luan logs 1>logs/stdout.log 2>logs/stderr.log
else
  java -Xms1024M -classpath $CLASSPATH luan.Luan run.luan logs 1>logs/stdout.log 2>logs/stderr.log &

  getPids;
  if [ "$PIDS" == "" ]; then
    while [ $i -lt $toWait ]; do
      sleep 1;
      getPids;
      if [ "$PIDS" != "" ]; then
        break
      fi;
      let i=$i+1;
    done;
  fi;

  checkRunning;
fi;