-
Notifications
You must be signed in to change notification settings - Fork 10
/
informix_setup_sqlhosts.sh
executable file
·52 lines (47 loc) · 1.72 KB
/
informix_setup_sqlhosts.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# name: informix_setup_sqlhosts.sh:
# description: Setup the sqlhosts file in the docker image
# Called by: informix_entry.sh
TRUE=1
FALSE=0
if ( ifFileExists $INFORMIX_CONFIG_DIR/sqlhosts )
then
MSGLOG ">>> DEBUG: FILEEXISTS=1" N
FILEEXISTS=1
else
MSGLOG ">>> DEBUG: FILEEXISTS=0" N
FILEEXISTS=0
fi
if ( $(isEnvSet $env_SQLHOSTS_FILE) )
then
MSGLOG ">>> Using sqlhosts supplied by user" N
if [[ $env_STORAGE == "LOCAL" ]]
then
cp $INFORMIX_CONFIG_DIR/$env_SQLHOSTS_FILE $INFORMIXSQLHOSTS
else
ln -s $INFORMIX_CONFIG_DIR/$env_SQLHOSTS_FILE $INFORMIXSQLHOSTS
fi
else
MSGLOG ">>> Creating DEFAULT sqlhosts " N
if [[ $env_STORAGE == "LOCAL" ]]
then
touch $INFORMIXSQLHOSTS
else
MSGLOG ">>> touch $INFORMIX_CONFIG_DIR/sqlhosts" N
touch $INFORMIX_CONFIG_DIR/sqlhosts
ln -s $INFORMIX_CONFIG_DIR/sqlhosts $INFORMIXSQLHOSTS
fi
fi
if [[ -z $env_SQLHOSTS_FILE && $FILEEXISTS -eq $FALSE ]]
then
RUNAS root "cat /dev/null > $INFORMIXSQLHOSTS "
RUNAS root "echo '############################################################' >> ${INFORMIXSQLHOSTS}"
RUNAS root "echo '### DO NOT MODIFY THIS COMMENT SECTION '>> ${INFORMIXSQLHOSTS}"
RUNAS root "echo '### HOST NAME = ${HOSTNAME} ' >> ${INFORMIXSQLHOSTS}"
RUNAS root "echo '############################################################' >> ${INFORMIXSQLHOSTS}"
RUNAS root "echo '${INFORMIXSERVER} onsoctcp *${HOSTNAME} 9088' >> ${INFORMIXSQLHOSTS}"
RUNAS root "echo '${INFORMIXSERVER}_dr drsoctcp *${HOSTNAME} 9089' >> ${INFORMIXSQLHOSTS}"
else
MSGLOG ">>> Using Exiting SQLHOSTS $INFORMIX_CONFIG_DIR/sqlhosts" N
fi