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>2017-04-27 18:33:31 +0300
committernachoparker <nacho@ownyourbits.com>2017-04-27 19:49:27 +0300
commitbe2e4e610b3873f89672b2930541058461c9e11d (patch)
treed94954a531f0f499b13208eb55f677b92736aebd
parent64bf42f2f3dd18f294d8626aaf412c90760277f0 (diff)
keep current configuration on remote updatesv0.8.2
-rwxr-xr-xupdate.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/update.sh b/update.sh
index 891126cb..6050d316 100755
--- a/update.sh
+++ b/update.sh
@@ -24,6 +24,14 @@ done
for file in etc/nextcloudpi-config.d/*; do
[ -f $file ] || continue;
[ -f /usr/local/$file ] || install_script $file
+
+ # save current configuration to (possibly) updated script
+ VARS=( $( grep "^[[:alpha:]]\+_=" /usr/local/$file | cut -d= -f1 ) )
+ VALS=( $( grep "^[[:alpha:]]\+_=" /usr/local/$file | cut -d= -f2 ) )
+ for i in `seq 0 1 ${#VARS[@]} `; do
+ sed -i "s|^${VARS[$i]}=.*|${VARS[$i]}=${VALS[$i]}|" $file
+ done
+
cp $file /usr/local/$file
done