gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 line
1.3KB

  1. #!/bin/sh
  2. set -e
  3. ODOO_CONFIGURATION_FILE=/etc/odoo/odoo.conf
  4. ODOO_GROUP="odoo"
  5. ODOO_DATA_DIR=/var/lib/odoo
  6. ODOO_LOG_DIR=/var/log/odoo
  7. ODOO_USER="odoo"
  8. GSFONTS_DIR=/usr/share/fonts/type1/gsfonts
  9. case "${1}" in
  10. configure)
  11. if ! getent passwd | grep -q "^odoo:"; then
  12. adduser --system --home $ODOO_DATA_DIR --quiet --group $ODOO_USER
  13. # Data dir
  14. chown $ODOO_USER:$ODOO_GROUP $ODOO_DATA_DIR
  15. fi
  16. # Register "$ODOO_USER" as a postgres user with "Create DB" role attribute
  17. su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true
  18. # Configuration file
  19. chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE
  20. chmod 0640 $ODOO_CONFIGURATION_FILE
  21. # Log
  22. mkdir -p $ODOO_LOG_DIR
  23. chown $ODOO_USER:$ODOO_GROUP $ODOO_LOG_DIR
  24. chmod 0750 $ODOO_LOG_DIR
  25. # work around https://bugs.debian.org/1059326
  26. if ! [ -e ${GSFONTS_DIR}/n021003l.pfb ] ; then
  27. if ! [ -d ${GSFONTS_DIR} ] ; then
  28. mkdir ${GSFONTS_DIR}
  29. touch ${GSFONTS_DIR}/.created-by-odoo-package
  30. fi
  31. ln -s /usr/share/fonts/X11/Type1/C059-Roman.pfb ${GSFONTS_DIR}/n021003l.pfb
  32. fi
  33. ;;
  34. *)
  35. ;;
  36. esac
  37. #DEBHELPER#
  38. exit 0
上海开阖软件有限公司 沪ICP备12045867号-1