Fix Nextcloud installation step

This commit is contained in:
David Duque 2022-09-10 15:52:17 +01:00
parent dc787b67b4
commit e7ee4bc5b4
2 changed files with 8 additions and 5 deletions

View file

@ -14,7 +14,7 @@ function hide_output {
# Execute command, redirecting stderr/stdout to the temporary file. Since we # Execute command, redirecting stderr/stdout to the temporary file. Since we
# check the return code ourselves, disable 'set -e' temporarily. # check the return code ourselves, disable 'set -e' temporarily.
set +e set +e
"$@" &> $OUTPUT "$@" &> "$OUTPUT"
E=$? E=$?
set -e set -e
@ -24,7 +24,7 @@ function hide_output {
echo echo
echo FAILED: "$@" echo FAILED: "$@"
echo ----------------------------------------- echo -----------------------------------------
cat $OUTPUT cat "$OUTPUT"
echo ----------------------------------------- echo -----------------------------------------
exit $E exit $E
fi fi

View file

@ -86,6 +86,7 @@ InstallNextcloud() {
IFS='.' IFS='.'
read -a checkVer <<< "$version_contacts" read -a checkVer <<< "$version_contacts"
unset IFS
if [ "${checkVer[0]}" -gt 4 ] || [ "${checkVer[0]}" -eq 4 -a "${checkVer[1]}" -gt 0 ] || [ "${checkVer[0]}" -eq 4 -a "${checkVer[2]}" -gt 0 ]; then if [ "${checkVer[0]}" -gt 4 ] || [ "${checkVer[0]}" -eq 4 -a "${checkVer[1]}" -gt 0 ] || [ "${checkVer[0]}" -eq 4 -a "${checkVer[2]}" -gt 0 ]; then
# Contacts 4.0.1 and later are downloaded from here # Contacts 4.0.1 and later are downloaded from here
wget_verify https://github.com/nextcloud-releases/contacts/releases/download/v$version_contacts/contacts-v$version_contacts.tar.gz $hash_contacts /tmp/contacts.tgz wget_verify https://github.com/nextcloud-releases/contacts/releases/download/v$version_contacts/contacts-v$version_contacts.tar.gz $hash_contacts /tmp/contacts.tgz
@ -98,7 +99,8 @@ InstallNextcloud() {
IFS='.' IFS='.'
read -a checkVer <<< "$version_calendar" read -a checkVer <<< "$version_calendar"
if [ "${checkVer[0]}" -eq 2 && "${checkVer[1]}" -gt 2 ] || [ "${checkVer[0]}" -gt 2 ]; then unset IFS
if [ "${checkVer[0]}" -eq 2 -a "${checkVer[1]}" -gt 2 ] || [ "${checkVer[0]}" -gt 2 ]; then
# Calendar 2.3.0 and later are downloaded from here # Calendar 2.3.0 and later are downloaded from here
wget_verify https://github.com/nextcloud-releases/calendar/releases/download/v$version_calendar/calendar-v$version_calendar.tar.gz $hash_calendar /tmp/calendar.tgz wget_verify https://github.com/nextcloud-releases/calendar/releases/download/v$version_calendar/calendar-v$version_calendar.tar.gz $hash_calendar /tmp/calendar.tgz
else else
@ -112,10 +114,11 @@ InstallNextcloud() {
if [ -n "$version_user_external" ]; then if [ -n "$version_user_external" ]; then
IFS='.' IFS='.'
read -a checkVer <<< "$version_user_external" read -a checkVer <<< "$version_user_external"
unset IFS
if [ "${checkVer[0]}" -gt 2 ]; then if [ "${checkVer[0]}" -gt 2 ]; then
wget_verify https://github.com/nextcloud-releases/user_external/releases/download/v$version_user_external/user_external-v$version_user_external.tar.gz $hash_user_external /tmp/user_external wget_verify https://github.com/nextcloud-releases/user_external/releases/download/v$version_user_external/user_external-v$version_user_external.tar.gz $hash_user_external /tmp/user_external.tgz
else else
wget_verify https://github.com/nextcloud/user_external/releases/download/v$version_user_external/user_external-$version_user_external.tar.gz $hash_user_external /tmp/user_external wget_verify https://github.com/nextcloud/user_external/releases/download/v$version_user_external/user_external-$version_user_external.tar.gz $hash_user_external /tmp/user_external.tgz
fi fi
tar -xf /tmp/user_external.tgz -C /usr/local/lib/owncloud/apps/ tar -xf /tmp/user_external.tgz -C /usr/local/lib/owncloud/apps/
rm /tmp/user_external.tgz rm /tmp/user_external.tgz