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

3
echo "Running server in the background"
4
cmd="pm2 start pm2.pubsweet.config.js"
Nikos Marinos's avatar
Nikos Marinos committed
5 6 7

$cmd &

8 9 10
echo "Wait forever for server to respond, check every 20 seconds"
while true
do
11
   RUNNING=$(curl --silent --connect-timeout 20 "http://localhost:$APP_SERVER_PORT" | grep "/assets/")
12 13 14 15 16 17
   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
18 19
       echo "Finished running post_init.sh"
       break
20 21 22 23 24
   fi
   echo "Waiting for xPub..."
   sleep 20
done

25
echo "Finished init."
Nikos Marinos's avatar
Nikos Marinos committed
26

27
tail -f /dev/null