users_common.sh 779 B

12345678910111213141516171819202122232425262728
  1. # shell include script
  2. KOPANO_LANG="${KOPANO_USERSCRIPT_LOCALE:-${LC_MESSAGES:-en_US}}"
  3. PATH=/bin:/usr/local/bin:/usr/bin
  4. export KOPANO_LANG PATH
  5. if [ -z "${KOPANO_USER_SCRIPTS}" ] ; then
  6. exec >&2
  7. echo "Do not execute this script directly"
  8. exit 1
  9. fi
  10. if [ ! -d "${KOPANO_USER_SCRIPTS}" ] ; then
  11. exec >&2
  12. echo "${KOPANO_USER_SCRIPTS} does not exist or is not a directory"
  13. exit 1
  14. fi
  15. if [ -z "${KOPANO_USER}" -a -z "${KOPANO_STOREGUID}" ] ; then
  16. exec >&2
  17. echo "KOPANO_USER and KOPANO_STOREGUID is not set."
  18. exit 1
  19. fi
  20. # Find cannot cope with unreadable cwd
  21. cd "$KOPANO_USER_SCRIPTS"
  22. find "${KOPANO_USER_SCRIPTS}" -maxdepth 1 -type f -perm -u=x -not -name \*~ -not -name \#\* -not -name \*.rpm\* -not -name \*.bak -not -name \*.old -exec {} \;