-
Notifications
You must be signed in to change notification settings - Fork 7
/
create-qm.sh
36 lines (30 loc) · 1.04 KB
/
create-qm.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
#!/bin/bash
# Load configs:
source install-mq.cfg
source create-qm.cfg
# Load function definitions:
source lib/try-run.sh
source lib/notices.sh
echo $MQ_BIN
# Get queue managers list:
queueManagers=$(ls -1 /install/mqsc/*.mqsc | xargs -n1 basename | sed -e 's/\.[a-zA-Z]*$//')
# For each MQSC file, create queue manager and import its configuration:
for qm in $queueManagers
do
showNotice "Creating queue manager: $qm..."
# Check if queue manager exists:
qmExists=`sudo -u mqm -H sh -c "${MQ_BIN}dspmq | grep $qm"`
if [ -n "$qmExists" ]
then
showWarning "Queue manager $qm already exists. Skipping."
continue
fi
# Create queue manager as mqm user:
sudo -u mqm -H sh -c "${MQ_BIN}crtmqm -lf 16384 -lp 20 -ls 50 -u SYSTEM.DEAD.LETTER.QUEUE $qm"
# Start queue manager:
sudo -u mqm -H sh -c "${MQ_BIN}strmqm $qm"
# Import queue manager's config:
sudo -u mqm -H sh -c "${MQ_BIN}runmqsc $qm < ${MQSC_CONFIG_FILES}${qm}.mqsc > ${MQSC_CONFIG_FILES}${qm}.out"
# Start listener:
sudo -u mqm -H sh -c "${MQ_BIN}runmqsc $qm" <<< "START LISTENER($qm)"
done