From 5def1c199555816c4dc4b7a27d228a33d8572855 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 25 Mar 2023 12:05:31 +0100 Subject: [PATCH] Update 02-init_steps.sh --- nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh index fd1a6cbfd..c095a052c 100755 --- a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh +++ b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh @@ -34,6 +34,13 @@ if [ ! -f /data/config/www/nextcloud/occ ]; then LAUNCHER="apk" fi +# Check current version +if [ -f /data/config/www/nextcloud/version.php]; then + CURRENTVERSION="$(sed -n "s|.*\OC_VersionString = '*\(.*[^ ]\) *';.*|\1|p" /data/config/www/nextcloud/version.php)" +else + CURRENTVERSION="Not found" +fi + # If not installed, or files not available if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]] || [ ! -f /data/config/www/nextcloud/version.php ]; then bashio::log.green "--------------------------------------------------------------------------------------------------------------" @@ -42,8 +49,6 @@ if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]] || [ ! -f /data/config/www/ne bashio::log.green " " exit 0 elif [[ $($LAUNCHER -V 2>&1) == *"Nextcloud"* ]]; then - # Check current version - CURRENTVERSION="$(sed -n "s|.*\OC_VersionString = '*\(.*[^ ]\) *';.*|\1|p" /data/config/www/nextcloud/version.php)" # Log bashio::log.green "--------------------------------------" bashio::log.green "Nextcloud $CURRENTVERSION is installed"