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
rudolfkoenig af8a6393d9 fhem.pl forgotten
git-svn-id: https://svn.fhem.de/fhem/trunk@1018 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2011-09-23 11:56:08 +00:00

25 lines
615 B
Bash

#!/bin/sh
set -e
if ! getent passwd fhem >/dev/null; then
useradd --system --home /var/log/fhem --gid dialout --shell /bin/false fhem
fi
chown -R fhem /var/log/fhem /etc/fhem.cfg /usr/share/fhem /usr/bin/fhem.pl
#set up of autostart
if test -x /sbin/initctl; then
# upstart
mkdir -p /etc/init
cp /usr/share/fhem/contrib/init-scripts/fhem.upstart /etc/init/fhem.conf
initctl start fhem
else
# Sysvinit
mkdir -p /etc/init.d
cp /usr/share/fhem/contrib/init-scripts/fhem.3 /etc/init.d/fhem
chmod ugo+x /etc/init.d/fhem
update-rc.d fhem defaults
invoke-rc.d fhem start
fi