Skip to content

Instantly share code, notes, and snippets.

@mccun934
Last active March 16, 2018 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mccun934/4bd25030770ea96e229e9e53ff562179 to your computer and use it in GitHub Desktop.
Save mccun934/4bd25030770ea96e229e9e53ff562179 to your computer and use it in GitHub Desktop.
# EG : ALTER USER Postgres WITH PASSWORD '<newpassword>';
CP_PASS=`grep jpa.config.hibernate.connection.password /etc/candlepin/candlepin.conf | awk -F= '{print $2}'`
F_PASS=`grep password /etc/foreman/database.yml | awk -F: '{print $2}' | sed 's/"//g'`
echo "ALTER USER candlepin WITH PASSWORD '$CP_PASS';" | sudo -u postgres psql
echo "ALTER USER foreman WITH PASSWORD '$F_PASS';" | sudo -u postgres psql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment