#!/bin/sh
set -e

# Add Vector to adm group to read /var/logs
usermod --append --groups adm vector || true

# If the systemd-journal group is present
if getent group | grep 'systemd-journal'
then
  # Add Vector to systemd-journal to read journald logs
  usermod --append --groups systemd-journal vector || true
  # Reload the daemon to reflect new group membership
  systemctl daemon-reload || true
fi

#DEBHELPER#
