allow to install not-latest nextcloud versions (#1714)

* allow to install not-latest nextcloud versions

Signed-off-by: szaimen <szaimen@e.mail.de>

* fix detail

Signed-off-by: szaimen <szaimen@e.mail.de>

* fix formatting

Signed-off-by: szaimen <szaimen@e.mail.de>

* improve readability

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2020-12-12 21:02:17 +01:00 committed by GitHub
parent f1612cc34f
commit 36432522d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View File

@ -26,7 +26,8 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
"Nextcloud Configuration" "(Choose between available Nextcloud configurations)" \
"Startup Configuration" "(Choose between available startup configurations)" \
"Server Configuration" "(Choose between available server configurations)" \
"Update Nextcloud" "(Update Nextcloud to the latest release)" 3>&1 1>&2 2>&3)
"Update Nextcloud major" "(Update Nextcloud to the latest major release)" \
"Update Nextcloud minor" "(Update Nextcloud to the latest minor release)" 3>&1 1>&2 2>&3)
case "$choice" in
"Additional Apps")
@ -45,7 +46,7 @@ case "$choice" in
print_text_in_color "$ICyan" "Downloading the Server Configuration Menu..."
run_script MENU server_configuration
;;
"Update Nextcloud")
"Update Nextcloud major")
if [ -f "$SCRIPTS"/update.sh ]
then
bash "$SCRIPTS"/update.sh
@ -56,6 +57,17 @@ case "$choice" in
bash "$SCRIPTS"/update.sh
fi
;;
"Update Nextcloud minor")
if [ -f "$SCRIPTS"/update.sh ]
then
bash "$SCRIPTS"/update.sh minor
else
print_text_in_color "$ICyan" "Downloading the Update script..."
download_script STATIC update
chmod +x "$SCRIPTS"/update.sh
bash "$SCRIPTS"/update.sh minor
fi
;;
*)
;;
esac

View File

@ -538,7 +538,7 @@ ROOTNEWPROFILE
# Upgrade system
print_text_in_color "$ICyan" "System will now upgrade..."
bash $SCRIPTS/update.sh
bash $SCRIPTS/update.sh minor
# Cleanup 2
apt autoremove -y

View File

@ -31,6 +31,11 @@ then
print_text_in_color "$ICyan" "Running in provisioning mode..."
export PROVISIONING=1
sleep 1
elif [ "$1" = "--not-latest" ]
then
NOT_LATEST=1
print_text_in_color "$ICyan" "Running in not-latest mode..."
sleep 1
else
msg_box "Failed to get the correct flag. Did you enter it correctly?"
exit 1
@ -431,6 +436,19 @@ calculate_php_fpm
# Install VM-tools
install_if_not open-vm-tools
# Get not-latest Nextcloud version
if [ -n "$NOT_LATEST" ]
then
while [ -z "$NCVERSION" ]
do
print_text_in_color "$ICyan" "Fetching the not-latest Nextcloud version..."
NCVERSION=$(curl -s -m 900 $NCREPO/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' \
| sort --version-sort | grep -v "\.0$\|\.1$\|\.2$" | tail -1)
STABLEVERSION="nextcloud-$NCVERSION"
print_text_in_color "$IGreen" "$NCVERSION"
done
fi
# Download and validate Nextcloud package
check_command download_verify_nextcloud_stable