mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-18 07:37:48 +01:00
8472f27ec5
GitOrigin-RevId: ddf02e70d2827c048db49b687ebbcdcc67807ca6
37 lines
801 B
Django/Jinja
37 lines
801 B
Django/Jinja
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
case "$1" in
|
|
configure)
|
|
{% if add_user -%}
|
|
id -u {{ add_user }} &>/dev/null || adduser --disabled-password --gecos "" {{ add_user }}
|
|
{% for group in user_groups %}
|
|
usermod -a -G {{ group }} {{ add_user }}
|
|
{%- endfor %}
|
|
{%- endif -%}
|
|
{% for line in extra_postinst %}
|
|
{{ line }}
|
|
{%- endfor %}
|
|
{% for line in services %}
|
|
systemctl enable {{ line }}
|
|
systemctl daemon-reload
|
|
service {{ line }} start
|
|
{%- endfor %}
|
|
{% if restart_nginx -%}
|
|
service nginx reload || service nginx restart
|
|
{%- endif %}
|
|
;;
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
;;
|
|
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|