27 lines
481 B
Bash
27 lines
481 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -eu -o pipefail
|
||
|
|
||
|
setup_root_user() {
|
||
|
set -eu
|
||
|
|
||
|
if ! grep -q "$ADMIN_USER" /opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json; then
|
||
|
if /opt/jboss/keycloak/bin/add-user-keycloak.sh -r master -u "$ADMIN_USER" -p "$ADMIN_PASS"; then
|
||
|
echo "=====> root user added"
|
||
|
else
|
||
|
echo "=====> Failed to add root user"
|
||
|
exit 1
|
||
|
fi
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
main() {
|
||
|
set -eu
|
||
|
|
||
|
setup_root_user
|
||
|
}
|
||
|
|
||
|
main
|
||
|
|
||
|
/usr/bin/entrypoint "$@"
|