#!/bin/bash
#
# Install script for amt package
# Copyright Daniel Mehrmann (Akusari) 2024
#

echo "Create monitor user and group..."

sudo groupadd -g 1005 monitor
sudo useradd -u 1004 -g 1005 -c "Monitor system" -s /usr/bin/nologin -d /tmp -M monitor

echo "Copy system-backup.slice to /etc/systemd/system"

if [ -f /usr/local/share/amt/system-backup.slice ]; then
   sudo cp /usr/local/share/amt/system-backup.slice /etc/systemd/system/
fi

/usr/bin/systemctl daemon-reload

echo "Add user monitor to journald group"

sudo usermod -a -G systemd-journal monitor 
