Add postgres and rabbitmq password update scripts
This commit is contained in:
parent
579dfe5b9e
commit
d0d21f1bc5
2 changed files with 42 additions and 0 deletions
21
utils/update-rabbitmq-password
Executable file
21
utils/update-rabbitmq-password
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -u
|
||||
|
||||
error() {
|
||||
echo >&2 "error: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Make sure only root can run our script
|
||||
(($( id -u) == 0)) || error "this script must be run as root!"
|
||||
|
||||
command -v openssl > /dev/null || error "openssl command not found!"
|
||||
command -v rabbitmqctl > /dev/null || error "rabbitmqctl command not found!"
|
||||
|
||||
typeset -r RMQ_USER="airtime"
|
||||
typeset -r RMQ_PASSWORD=$(openssl rand -hex 16)
|
||||
|
||||
# RabbitMQ
|
||||
echo "Changing password for rabbitmq user '$RMQ_USER' to '$RMQ_PASSWORD'"
|
||||
rabbitmqctl change_password "$RMQ_USER" "$RMQ_PASSWORD"
|
Loading…
Add table
Add a link
Reference in a new issue