post_install() { getent group wildfly >/dev/null 2>&1 || \ groupadd -r wildfly getent passwd wildfly >/dev/null 2>&1 || \ useradd -g wildfly -d /opt/wildfly -s /bin/bash -r wildfly chown -R wildfly:wildfly /opt/wildfly echo " Wildfly is installed as a systemd service. You should run the add-user" echo " script (/opt/wildfly/bin/add-user.sh) in order to add a management user" echo " if you want to access the management console, which listens locally on" echo " port 9990. The main server listens on all networks at port 8080." } post_upgrade() { post_install "$1" } pre_remove() { systemctl disable wildfly systemctl stop wildfly wait if getent passwd wildfly >/dev/null 2>&1; then userdel wildfly fi if getent group wildfly >/dev/null 2>&1; then groupdel wildfly fi }