Skip to content

Instantly share code, notes, and snippets.

@jsalvet
Created January 12, 2014 22:40
Show Gist options
  • Save jsalvet/8391636 to your computer and use it in GitHub Desktop.
Save jsalvet/8391636 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z $1 ]
then
echo "Usage: `basename $0` username password"
exit 0
fi
sudo -u rabbitmq rabbitmqctl add_user "$1" "$2"
sudo -u rabbitmq rabbitmqctl add_vhost "$1"
sudo -u rabbitmq rabbitmqctl set_permissions -p "$1" "$1" ".*" ".*" ".*"
echo "BROKER_URL = \"amqp://$1:[email protected]:5672/$1\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment