Files
extra/unbound/unbound.install
2025-06-22 20:39:04 -05:00

12 lines
489 B
Plaintext

post_install() {
getent group unbound &>/dev/null || groupadd -r unbound >/dev/null
getent passwd unbound &>/dev/null || useradd -r -g unbound -G adm -d /etc/unbound -s /bin/nologin -c unbound unbound >/dev/null
if ! groups unbound | grep adm &>/dev/null; then
gpasswd -a unbound adm >/dev/null
fi
unbound_shell=$(getent passwd unbound | cut -d: -f7)
if [ "$unbound_shell" != '/bin/nologin' ]; then
chsh -s /bin/nologin unbound &>/dev/null
fi
}