2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

25 lines
552 B
Plaintext
Raw Normal View History

#!/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 /opt/fhem
#set up of autostart
if test -x /sbin/initctl; then
# upstart
mkdir -p /etc/init
cp /opt/fhem/contrib/init-scripts/fhem.upstart /etc/init/fhem.conf
initctl start fhem
else
# Sysvinit
mkdir -p /etc/init.d
cp /opt/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