Split install script in two (local or remote), avoiding install docker if remote approach was chose
This commit is contained in:
parent
511f0de62d
commit
b0cddb4b33
@ -1,16 +0,0 @@
|
||||
FROM openjdk:8-jre
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt update
|
||||
|
||||
RUN apt -y install locales-all fontconfig libxt6 libxrender1
|
||||
RUN apt -y install --no-install-recommends libreoffice fonts-crosextra-carlito fonts-crosextra-caladea fonts-noto fonts-noto-cjk
|
||||
|
||||
|
||||
RUN dpkg-reconfigure fontconfig && fc-cache -f -s -v
|
||||
|
||||
VOLUME ["/usr/share/fonts/"]
|
||||
ADD ./bbb-libreoffice-entrypoint.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/bbb-libreoffice-entrypoint.sh" ]
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Initialize environment
|
||||
/usr/lib/libreoffice/program/soffice.bin -env:UserInstallation="file:///tmp/"
|
||||
|
||||
## Run daemon
|
||||
/usr/lib/libreoffice/program/soffice.bin --accept="socket,host=0.0.0.0,port=8000,tcpNoDelay=1;urp;StarOffice.ServiceManager" --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nolockcheck --nologo --norestore -env:UserInstallation="file:///tmp/"
|
@ -4,6 +4,8 @@ if [ "$EUID" -ne 0 ]; then
|
||||
exit 1;
|
||||
fi;
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
DOCKER_CHECK=`docker --version &> /dev/null && echo 1 || echo 0`
|
||||
|
||||
if [ "$DOCKER_CHECK" = "0" ]; then
|
||||
@ -33,11 +35,7 @@ FOLDER_CHECK=`[ -d /usr/share/bbb-libreoffice-conversion/ ] && echo 1 || echo 0`
|
||||
if [ "$FOLDER_CHECK" = "0" ]; then
|
||||
echo "Install folder doesn't exists, installing"
|
||||
mkdir -m 755 /usr/share/bbb-libreoffice-conversion/
|
||||
cp assets/convert-local.sh /usr/share/bbb-libreoffice-conversion/
|
||||
cp assets/convert-remote.sh /usr/share/bbb-libreoffice-conversion/
|
||||
ln -sfn /usr/share/bbb-libreoffice-conversion/convert-local.sh /usr/share/bbb-libreoffice-conversion/convert.sh
|
||||
chmod 755 /usr/share/bbb-libreoffice-conversion/convert-local.sh
|
||||
chmod 755 /usr/share/bbb-libreoffice-conversion/convert-remote.sh
|
||||
cp assets/convert-local.sh /usr/share/bbb-libreoffice-conversion/convert.sh
|
||||
chmod 755 /usr/share/bbb-libreoffice-conversion/convert.sh
|
||||
chown -R root /usr/share/bbb-libreoffice-conversion/
|
||||
else
|
19
bbb-libreoffice/install-remote.sh
Executable file
19
bbb-libreoffice/install-remote.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run this script as root ( or with sudo )" ;
|
||||
exit 1;
|
||||
fi;
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
FOLDER_CHECK=`[ -d /usr/share/bbb-libreoffice-conversion/ ] && echo 1 || echo 0`
|
||||
if [ "$FOLDER_CHECK" = "0" ]; then
|
||||
echo "Install folder doesn't exists, installing"
|
||||
mkdir -m 755 /usr/share/bbb-libreoffice-conversion/
|
||||
cp assets/convert-remote.sh /usr/share/bbb-libreoffice-conversion/convert.sh
|
||||
chmod 755 /usr/share/bbb-libreoffice-conversion/convert.sh
|
||||
chown -R root /usr/share/bbb-libreoffice-conversion/
|
||||
else
|
||||
echo "Install folder already exists"
|
||||
fi;
|
||||
|
@ -24,11 +24,3 @@ if [ "$FILE_SUDOERS_CHECK" = "1" ]; then
|
||||
echo "Removing Sudoers file"
|
||||
rm /etc/sudoers.d/zzz-bbb-docker-libreoffice
|
||||
fi;
|
||||
|
||||
|
||||
NETWORK_CHECK=`docker network inspect bbb-libreoffice &> /dev/null && echo 1 || echo 0`
|
||||
if [ "$NETWORK_CHECK" = "1" ]; then
|
||||
echo "Removing docker network"
|
||||
docker network remove bbb-libreoffice
|
||||
fi
|
||||
|
14
bbb-libreoffice/uninstall-remote.sh
Executable file
14
bbb-libreoffice/uninstall-remote.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run this script as root ( or with sudo )" ;
|
||||
exit 1;
|
||||
fi;
|
||||
|
||||
|
||||
FOLDER_CHECK=`[ -d /usr/share/bbb-libreoffice-conversion/ ] && echo 1 || echo 0`
|
||||
if [ "$FOLDER_CHECK" = "1" ]; then
|
||||
echo "Removing install folder"
|
||||
rm -rf /usr/share/bbb-libreoffice-conversion/
|
||||
fi;
|
Loading…
Reference in New Issue
Block a user