wrapperScript.sh 728 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5
echo "Running pre_init.sh script"
./pre_init.sh

6
echo "Running server in the background"
7
cmd="pm2 start pm2.pubsweet.config.js"
Nikos Marinos's avatar
Nikos Marinos committed
8 9 10

$cmd &

11 12 13
echo "Wait forever for server to respond, check every 20 seconds"
while true
do
14
   RUNNING=$(curl --silent --connect-timeout 20 "http://localhost:$APP_SERVER_PORT" | grep "/assets/")
15 16 17 18 19 20
   if [ -n "$RUNNING" ] ; then
       echo "xPub is running"
       #echo "Creating the Users"
       #node scripts/adduser.js rakeshnambiar rakeshnbr@ebi.ac.uk Password_01 false
       echo "Running post_init.sh script"
       ./post_init.sh
21 22
       echo "Finished running post_init.sh"
       break
23 24 25 26 27
   fi
   echo "Waiting for xPub..."
   sleep 20
done

28
echo "Finished init."
Nikos Marinos's avatar
Nikos Marinos committed
29

30
tail -f /dev/null