This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
/
install-update-zimlet-only.sh
executable file
·71 lines (62 loc) · 2.71 KB
/
install-update-zimlet-only.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# This file is part of the Zimbra ownCloud Zimlet project.
# Copyright (C) 2015-2022 Barry de Graaff
#
# Bugs and feedback: https://github.com/Zimbra-Community/owncloud-zimlet/issues
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
OWNCLOUD_ZIMLET_PRODUCTION_PATH="/opt/zimbra/zimlets-deployed/tk_barrydegraaff_owncloud_zimlet"
OWNCLOUD_ZIMLET_DEV_PATH="/opt/zimbra/zimlets-deployed/_dev/tk_barrydegraaff_owncloud_zimlet"
DOCCONVERT_ZIMLET_PRODUCTION_PATH="/opt/zimbra/zimlets-deployed/tk_barrydegraaff_docconvert"
DOCCONVERT_ZIMLET_DEV_PATH="/opt/zimbra/zimlets-deployed/_dev/tk_barrydegraaff_docconvert"
PROP2XML_JAR_URL="https://github.com/Zimbra-Community/prop2xml/raw/master/out/artifacts/prop2xml_jar/prop2xml.jar"
# We only support java versions bundled with Zimbra
if [[ -x "/opt/zimbra/common/bin/java" ]]
then
#8.7
[[ ":$PATH:" != *":/opt/zimbra/common/bin:"* ]] && PATH="/opt/zimbra/common/bin:${PATH}"
export PATH
elif [[ -x "/opt/zimbra/java/bin/java" ]]
then
#8.6
[[ ":$PATH:" != *":/opt/zimbra/java/bin:"* ]] && PATH="/opt/zimbra/java/bin:${PATH}"
export PATH
else
echo "Java is not found in /opt/zimbra"
exit 1
fi
if [ -d "${OWNCLOUD_ZIMLET_DEV_PATH}" ]
then
YNZIMLETISPRODUCTION="N"
else
YNZIMLETISPRODUCTION="Y"
fi
if [[ "$YNZIMLETISPRODUCTION" == 'N' || "$YNZIMLETISPRODUCTION" == 'n' ]];
then
echo "Using Development path (auto detected)"
OWNCLOUD_ZIMLET_PATH="${OWNCLOUD_ZIMLET_DEV_PATH}"
DOCCONVERT_ZIMLET_PATH="${DOCCONVERT_ZIMLET_DEV_PATH}"
else
echo "Using Production path (auto detected)"
OWNCLOUD_ZIMLET_PATH="${OWNCLOUD_ZIMLET_PRODUCTION_PATH}"
DOCCONVERT_ZIMLET_PATH="${DOCCONVERT_ZIMLET_PRODUCTION_PATH}"
fi
rm -Rf "${OWNCLOUD_ZIMLET_PATH}"/
mkdir "${OWNCLOUD_ZIMLET_PATH}"/
cp -rv zimlet/* "${OWNCLOUD_ZIMLET_PATH}"/
rm -f "${OWNCLOUD_ZIMLET_PATH}"/tk_barrydegraaff_owncloud_zimlet.zip
rm -f "${OWNCLOUD_ZIMLET_PATH}"/makefile
wget "${PROP2XML_JAR_URL}" -O /tmp/prop2xml.jar
java -jar /tmp/prop2xml.jar tk_barrydegraaff_owncloud_zimlet /opt/zimbra/lib/ext/ownCloud/config.properties "${OWNCLOUD_ZIMLET_PATH}"/config_template.xml
su zimbra -c "/opt/zimbra/bin/zmprov fc all"