#!/bin/bash
# This `DEBIAN/postinst` script is run post-installation
echo "Link service"
ln -s /usr/share/busylight/busylight.service /etc/systemd/system/
chmod 664 /etc/systemd/system/busylight.service
echo "Add service user"
useradd -r -s /bin/false busylight
echo "Set config dir"
chown -R busylight:busylight /var/local/busylight
chmod -R a+w /var/local/busylight
echo "Enable service"
systemctl enable busylight

ln -s /usr/share/busylight/busylight-color.py /bin/busylight-color
chmod 555 /bin/busylight-color