2019-04-08 18:26:01 +08:00
|
|
|
#!/bin/bash
|
2021-06-23 10:26:22 +08:00
|
|
|
DIR_HOME=("/opt/openoffice.org3" "/opt/libreoffice" "/opt/libreoffice6.1" "/opt/libreoffice7.0" "/opt/libreoffice7.1" "/opt/openoffice4" "/usr/lib/openoffice" "/usr/lib/libreoffice")
|
2019-04-16 13:48:57 +08:00
|
|
|
FLAG=
|
|
|
|
OFFICE_HOME=
|
2019-04-16 14:08:52 +08:00
|
|
|
KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")";pwd)
|
2019-04-14 22:45:18 +08:00
|
|
|
export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
|
|
|
|
cd $KKFILEVIEW_BIN_FOLDER
|
|
|
|
echo "Using KKFILEVIEW_BIN_FOLDER $KKFILEVIEW_BIN_FOLDER"
|
2019-10-24 19:16:55 +08:00
|
|
|
grep 'office\.home' ../config/application.properties | grep '!^#'
|
2019-04-16 13:48:57 +08:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "Using customized office.home"
|
|
|
|
else
|
|
|
|
for i in ${DIR_HOME[@]}
|
|
|
|
do
|
|
|
|
if [ -f $i"/program/soffice.bin" ]; then
|
|
|
|
FLAG=true
|
|
|
|
OFFICE_HOME=${i}
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ ! -n "${FLAG}" ]; then
|
|
|
|
echo "Installing OpenOffice"
|
2019-10-24 16:22:02 +08:00
|
|
|
sh ./install.sh
|
2019-04-16 13:48:57 +08:00
|
|
|
else
|
|
|
|
echo "Detected office component has been installed in $OFFICE_HOME"
|
|
|
|
fi
|
|
|
|
fi
|
2019-04-14 22:45:18 +08:00
|
|
|
echo "Starting kkFileView..."
|
2019-09-16 11:33:06 +08:00
|
|
|
echo "Please execute ./showlog.sh to check log for more information"
|
|
|
|
echo "You can get help in our official homesite: https://kkFileView.keking.cn"
|
2019-10-24 16:22:02 +08:00
|
|
|
echo "If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers"
|
2021-07-06 11:15:50 +08:00
|
|
|
nohup java -Dfile.encoding=UTF-8 -Dspring.config.location=../config/application.properties -jar kkFileView-4.0.0.jar > ../log/kkFileView.log 2>&1 &
|