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-05-20 11:57:40 +0300
committernachoparker <nacho@ownyourbits.com>2017-05-20 11:57:40 +0300
commit092d22acbcd87dc136a7595d9d4802add44e5270 (patch)
treef945e82b0a2a8474fb891eeb7d57bf858929ff6a
parent5977684cc04bb42d872e2cfd74c832e6fe00d85d (diff)
fix update.shv0.8.5
-rwxr-xr-xupdate.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/update.sh b/update.sh
index 6050d316..c23f0ebb 100755
--- a/update.sh
+++ b/update.sh
@@ -9,7 +9,6 @@
# More at https://ownyourbits.com/
#
-
cp etc/library.sh /usr/local/etc/
source /usr/local/etc/library.sh
@@ -26,11 +25,13 @@ for file in etc/nextcloudpi-config.d/*; do
[ -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
+ [ -f /usr/local/$file ] && {
+ 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