#!/bin/bash

# Make sure ownership and permissions on all our files are set properly.

/usr/sbin/adduser --system glitch

/bin/chown root: /etc/glitch/glitch.conf
/bin/chown glitch: /var/log/glitch /var/lib/glitch

if [ -x "/bin/systemctl" ]; then
  /bin/systemctl daemon-reload
  /bin/systemctl enable glitch
  /bin/systemctl try-restart glitch
fi
