post_install() { if [ "$(getent group rsyncd | cut -d ":" -f 3)" != "48" ]; then groupadd -g 48 rsyncd fi if [ "$(getent passwd rsyncd | cut -d ":" -f 3)" != "48" ]; then useradd -c "rsyncd Daemon" -m -d /srv/rsync -g rsyncd \ -s /bin/false -u 48 rsyncd fi systemctl enable rsyncd.service } post_upgrade() { pre_remove post_install } pre_remove() { systemctl stop rsyncd.socket systemctl stop rsyncd.service systemctl disable rsyncd.socket systemctl disable rsyncd.service } post_remove() { groupdel rsyncd 2>/dev/null || true userdel -r rsyncd 2>/dev/null || true }