-
Notifications
You must be signed in to change notification settings - Fork 11
/
informix_stop.sh
executable file
·74 lines (56 loc) · 1.02 KB
/
informix_stop.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
#
# name: informix_stop.sh:
# description: Stops Informix in Docker container
#
main()
{
###
### Setup environment
###
. /usr/local/bin/informix_inf.env
#MSGLOG ">>> Stopping the IBM Informix Database (${INFORMIXSERVER}) ... " N
#cp $INFORMIXDIR/etc/$ONCONFIG $INFORMIX_DATA_DIR/tmp
#cp $INFORMIXDIR/etc/sqlhosts $INFORMIX_DATA_DIR/tmp
[[ ! -z $CONFIGURE_INIT ]] && exit
onmode -kuy &
exec_K_initdb
}
###
### MSGLOG
###
function MSGLOG()
{
if [[ $2 = "N" ]]
then
#printf "%s\n" "$1" |tee -a $INIT_LOG
printf "%s\n" "$1" >> $INIT_LOG
echo "$1" >&2
else
#printf "%s" "$1" |tee -a $INIT_LOG
printf "%s" "$1" >> $INIT_LOG
echo "$1" >&2
fi
}
###
### exec_K_initdb
###
function exec_K_initdb()
{
MSGLOG ">>> " N
MSGLOG ">>> Execute init-shutdown scripts" N
MSGLOG ">>> " N
if [ -d $INFORMIX_DATA_DIR/init.d ]
then
filelist=`ls -x $INFORMIX_DATA_DIR/init.d/K*`
for f in $filelist
do
MSGLOG ">>> Processing: $f" N
done
MSGLOG ">>> " N
fi
}
###
### Call to main
###
main "$@"