forked from pnnlhep/b2s
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
39 lines (28 loc) · 1.96 KB
/
Copy pathstart.sh
File metadata and controls
39 lines (28 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash -e
PGSERVER=${PGSERVER:=127.0.0.1}
PGPORT=${PGPORT:=5432}
. /opt/b2s/b2s_env
if [ -x /srv/start/setup.sh ]
then
. /srv/start/setup.sh
fi
cd /opt/b2s
#FIXME set admin passwords.
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT start-domain b2s
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT start-local-instance b2sServer
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2s_cp.property.ServerName=$PGSERVER
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2s_cp.property.PortNumber=$PGPORT
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2s_cp.property.Password=$(awk -F: '{if($4=="user_cond"){print $5}}' /opt/b2s/.pgpass) 2>/dev/null
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2sAdm_cp.property.ServerName=$PGSERVER
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2sAdm_cp.property.PortNumber=$PGPORT
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT set resources.jdbc-connection-pool.b2sAdm_cp.property.Password=$(awk -F: '{if($4=="user_cond"){print $5}}' /opt/b2s/.pgpass) 2>/dev/null
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT restart-domain b2s
asadmin --passwordfile $GFPASSFILE --user admin --port $B2S_DAS_ADMIN_PORT restart-local-instance b2sServer
asadmin --user admin --passwordfile $GFPASSFILE --port $B2S_DAS_ADMIN_PORT deploy --target b2sServer ./b2s.war
#tail -f /opt/payara41/glassfish/domains/b2s/logs/server.log &
tail -f /opt/payara41/glassfish/nodes/localhost-b2s/b2sServer/logs/server.log &
#FIXME it would be nice to have a better way then this.
while true; do
ps ax | grep java | grep -v grep > /dev/null || exit 0;
sleep 5
done