Created
May 23, 2012 10:52
-
-
Save pfigue/2774550 to your computer and use it in GitHub Desktop.
Create a RabbitMQ vhost and user, and provide permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Syntax: create_rabbit_vhost.sh <vhost> <user> <pass> | |
if [ $# != 3 ]; then | |
echo "Fail! Syntax: $0 <vhost> <user> <pass>" | |
exit 1 | |
fi | |
rabbitmqctl add_vhost $1 | |
if [ $? != 0 ]; then | |
# echo "failed!" | |
exit 1 | |
fi | |
rabbitmqctl add_user $2 $3 | |
if [ $? != 0 ]; then | |
# echo "failed!" | |
exit 1 | |
fi | |
rabbitmqctl set_permissions $2 -p $1 ".*" ".*" ".*" | |
if [ $? != 0 ]; then | |
# echo "failed!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment