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:
Diffstat (limited to 'update.sh')
-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