package-pipelines-miscellan.../keycloak-25/debian.postinst

23 lines
584 B
Text
Raw Normal View History

2024-06-10 22:53:37 +02:00
#!/bin/bash
set -e
if [[ "$1" == "configure" ]]; then
if ! getent group keycloak >/dev/null; then
groupadd --system keycloak
fi
if ! getent passwd keycloak >/dev/null; then
useradd --system --gid keycloak --home-dir /opt/keycloak --shell /bin/false keycloak
fi
chown root:keycloak /opt/keycloak /etc/keycloak
chown keycloak:keycloak -R /opt/keycloak/lib/quarkus /opt/keycloak/data /opt/keycloak/ObjectStore
chmod 0750 /etc/keycloak
deb-systemd-helper enable keycloak.service
deb-systemd-invoke restart keycloak.service
fi