diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-07-02 04:15:46 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-07-06 06:43:54 +0300 |
commit | 35526ab9fcfc538b68a10bbf449d6b1fe5ea7d6d (patch) | |
tree | bf5f7762937f0fd38bb7463041e25726cc74bd16 /update.sh | |
parent | 88da901eddff125b3e71d9706fbe02edffc659b3 (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-x | update.sh | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 |