-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
57 lines (51 loc) · 1.21 KB
/
setup.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
#!/bin/bash
# USAGE: bash setup.sh -p port -u user -w password -h host -v vhost
# run this script to setup the Rabbitmq cli client
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-h|--host)
AMQP_HOST="$2"
shift # past argument
;;
-v|--vhost)
AMQP_VHOST="$2"
shift # past argument
;;
-p|--port)
AMQP_PORT="$2"
shift # past argument
;;
-u|--user)
AMQP_USER="$2"
shift # past argument
;;
-w|--password)
AMQP_PASSWORD="$2"
shift # past argument
;;
esac
shift # past argument or value
done
# configure the rabbitmq.profile
echo AMQP_HOST = "${AMQP_HOST}"
echo AMQP_VHOST = "${AMQP_VHOST}"
echo AMQP_PORT = "${AMQP_PORT}"
echo AMQP_USER = "${AMQP_USER}"
echo AMQP_PASSWORD = "${AMQP_PASSWORD}"
sed -e "s/\${amqp_host}/`echo ${AMQP_HOST}`/" -e "s/\${amqp_vhost}/`echo ${AMQP_VHOST}`/" \
-e "s/\${amqp_port}/`echo ${AMQP_PORT}`/" -e "s/\${amqp_user}/`echo ${AMQP_USER}`/" \
-e "s/\${amqp_password}/`echo ${AMQP_PASSWORD}`/" rabbitmq.profile.in | tee rabbitmq.profile
#build rabbitmq-c
cd rabbitmq-c
mkdir -p build
cd build
cmake ..
cmake --build .
cd ../../
# build amqptools
export AMQPTOOLS_RABBITHOME=$PWD/rabbitmq-c
cd amqptools
make
cd ..