2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00
fhem-mirror/fhem/contrib/DEBIAN/postinst
2017-12-25 16:36:50 +00:00

26 lines
505 B
Bash

#!/bin/bash
# $Id$
set -e
#set -x
if ! getent passwd fhem >/dev/null; then
useradd --system --home /opt/fhem --gid dialout --shell /bin/false fhem
fi
chown -R fhem:dialout /opt/fhem
# remove repository entry after first installation
sed -i /debian.fhem.de/d /etc/apt/sources.list
# set up of autostart (Sysvinit upstart no longer supported)
ln -s /opt/fhem/contrib/init-scripts/fhem.service /etc/systemd/system/.
systemctl enable fhem
# and start the fhem service
systemctl start fhem
exit 0