postinst 463 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -e
  3. #set -x
  4. if ! getent passwd fhem >/dev/null; then
  5. useradd --system --home /opt/fhem --gid dialout --shell /bin/false fhem
  6. fi
  7. chown -R fhem:dialout /opt/fhem
  8. # set up of autostart
  9. # Sysvinit; upstart no longer supported
  10. #mkdir -p /etc/init.d
  11. cp /opt/fhem/contrib/init-scripts/fhem.3 /etc/init.d/fhem
  12. chmod ugo+x /etc/init.d/fhem
  13. update-rc.d fhem defaults
  14. if test -f /etc/init.d/fhem; then
  15. /etc/init.d/fhem start noaptmark
  16. fi
  17. exit 0