2014-10-10 15:52:47 +00:00
|
|
|
#!/bin/bash
|
2017-02-27 20:44:26 +00:00
|
|
|
# $Id$
|
2010-08-02 12:47:55 +00:00
|
|
|
|
2010-09-30 13:12:28 +00:00
|
|
|
set -e
|
2014-11-09 13:19:57 +00:00
|
|
|
#set -x
|
2010-08-02 12:47:55 +00:00
|
|
|
|
2017-02-27 20:44:26 +00:00
|
|
|
|
|
|
|
|
2010-09-30 13:12:28 +00:00
|
|
|
if ! getent passwd fhem >/dev/null; then
|
2012-12-29 07:57:52 +00:00
|
|
|
useradd --system --home /opt/fhem --gid dialout --shell /bin/false fhem
|
2010-08-02 12:47:55 +00:00
|
|
|
fi
|
2010-09-30 13:12:28 +00:00
|
|
|
|
2015-01-20 13:49:15 +00:00
|
|
|
chown -R fhem:dialout /opt/fhem
|
2010-09-30 13:12:28 +00:00
|
|
|
|
2017-02-27 20:44:26 +00:00
|
|
|
# remove repository entry after first installation
|
|
|
|
sed -i /debian.fhem.de/d /etc/apt/sources.list
|
|
|
|
|
2014-09-22 11:58:11 +00:00
|
|
|
# set up of autostart
|
|
|
|
# Sysvinit; upstart no longer supported
|
|
|
|
|
2014-10-10 15:52:47 +00:00
|
|
|
#mkdir -p /etc/init.d
|
2014-09-22 11:58:11 +00:00
|
|
|
cp /opt/fhem/contrib/init-scripts/fhem.3 /etc/init.d/fhem
|
|
|
|
chmod ugo+x /etc/init.d/fhem
|
|
|
|
update-rc.d fhem defaults
|
2014-10-10 15:52:47 +00:00
|
|
|
|
|
|
|
if test -f /etc/init.d/fhem; then
|
2014-11-09 13:19:57 +00:00
|
|
|
/etc/init.d/fhem start noaptmark
|
2014-10-10 15:52:47 +00:00
|
|
|
fi
|
2014-11-09 13:19:57 +00:00
|
|
|
exit 0
|