startup.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. DIR_HOME=("/opt/openoffice.org3" "/opt/libreoffice" "/opt/openoffice4" "/usr/lib/openoffice" "/usr/lib/libreoffice")
  3. FLAG=
  4. OFFICE_HOME=
  5. KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")";pwd)
  6. export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
  7. cd $KKFILEVIEW_BIN_FOLDER
  8. echo "Using KKFILEVIEW_BIN_FOLDER $KKFILEVIEW_BIN_FOLDER"
  9. grep 'office\.home' ../config/application.properties | grep '!^#'
  10. if [ $? -eq 0 ]; then
  11. echo "Using customized office.home"
  12. else
  13. for i in ${DIR_HOME[@]}
  14. do
  15. if [ -f $i"/program/soffice.bin" ]; then
  16. FLAG=true
  17. OFFICE_HOME=${i}
  18. break
  19. fi
  20. done
  21. if [ ! -n "${FLAG}" ]; then
  22. echo "Installing OpenOffice"
  23. sh ./install.sh
  24. else
  25. echo "Detected office component has been installed in $OFFICE_HOME"
  26. fi
  27. fi
  28. echo "Starting kkFileView..."
  29. echo "Please execute ./showlog.sh to check log for more information"
  30. echo "You can get help in our official homesite: https://kkFileView.keking.cn"
  31. echo "If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers"
  32. nohup java -Dfile.encoding=UTF-8 -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../config/application.properties -jar kkFileView-2.2.0.jar > ../log/kkFileView.log 2>&1 &