Shape up admin install script
This commit is contained in:
parent
fff85fa306
commit
51c072d7ae
@ -2,16 +2,30 @@
|
|||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
setup_root_user() {
|
add_user() {
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
if ! grep -q "$ADMIN_USER" /opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json; then
|
keycloak_add_user_script="/opt/jboss/keycloak/bin/add-user-keycloak.sh"
|
||||||
if /opt/jboss/keycloak/bin/add-user-keycloak.sh -r master -u "$ADMIN_USER" -p "$ADMIN_PASS"; then
|
|
||||||
|
if $keycloak_add_user_script -r master -u "$ADMIN_USER" -p "$ADMIN_PASS"; then
|
||||||
echo "=====> root user added"
|
echo "=====> root user added"
|
||||||
else
|
else
|
||||||
echo "=====> Failed to add root user"
|
echo "=====> Failed to add root user"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_root_user() {
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
keycloak_add_user_json="/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json"
|
||||||
|
|
||||||
|
if [ ! -f "$keycloak_add_user_json" ]; then
|
||||||
|
add_user
|
||||||
|
else
|
||||||
|
if ! grep -q "$ADMIN_USER" "$keycloak_add_user_json"; then
|
||||||
|
add_user
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user