#!/bin/bash
#
# see: dh_installdeb(1)
set -e
if ! cat /etc/passwd | grep -q "onlyoffice:"; then
adduser --quiet --home /var/www/{{product}} --system --group onlyoffice
fi
if ! cat /etc/group | grep -q "nginx:"; then
addgroup --quiet --system nginx
if ! cat /etc/passwd | grep -q "nginx:"; then
adduser --quiet -g nginx --no-create-home --home /nonexistent --system nginx
usermod -aG nginx nginx
usermod -aG onlyoffice,nginx onlyoffice
chown -R onlyoffice:onlyoffice /var/log/onlyoffice/{{product}} /var/www/{{product}} /etc/onlyoffice/{{product}}
#DEBHELPER#