Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-07-02 04:15:46 +0300
committernachoparker <nacho@ownyourbits.com>2019-07-06 06:43:54 +0300
commit35526ab9fcfc538b68a10bbf449d6b1fe5ea7d6d (patch)
treebf5f7762937f0fd38bb7463041e25726cc74bd16 /update.sh
parent88da901eddff125b3e71d9706fbe02edffc659b3 (diff)
build: use a system wide config file. Remove sury sources
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/update.sh b/update.sh
index 4cd32684..8c6ea0c7 100755
--- a/update.sh
+++ b/update.sh
@@ -61,7 +61,18 @@ mkdir -p "$CONFDIR"
# copy all files in bin and etc
cp -r bin/* /usr/local/bin/
-find etc -maxdepth 1 -type f -exec cp '{}' /usr/local/etc \;
+find etc -maxdepth 1 -type f ! -path etc/ncp.cfg -exec cp '{}' /usr/local/etc \;
+cp -n etc/ncp.cfg /usr/local/etc
+
+# update NCVER in ncp.cfg and nc-nextcloud.cfg (for nc-autoupdate-nc and nc-update-nextcloud)
+nc_version=$(jq -r .nextcloud_version < etc/ncp.cfg)
+cfg="$(jq '.' /usr/local/etc/ncp.cfg)"
+cfg="$(jq ".nextcloud_version = \"$nc_version\"" <<<"$cfg")"
+echo "$cfg" > /usr/local/etc/ncp.cfg
+
+cfg="$(jq '.' etc/ncp-config.d/nc-nextcloud.cfg)"
+cfg="$(jq ".params[0].value = \"$nc_version\"" <<<"$cfg")"
+echo "$cfg" > /usr/local/etc/ncp-config.d/nc-nextcloud.cfg
# install new entries of ncp-config and update others
for file in etc/ncp-config.d/*; do
@@ -125,6 +136,8 @@ cp -r ncp-app /var/www/
# update old images
./run_update_history.sh "$UPDATESDIR"
+ # update to the latest NC version
+ is_active_app nc-autoupdate-nc && run_app nc-autoupdate-nc
}
exit 0