File tree Expand file tree Collapse file tree 10 files changed +80
-40
lines changed Expand file tree Collapse file tree 10 files changed +80
-40
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22set -eu
33
44# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767 local var=" $1 "
6868 local fileVar=" ${var} _FILE"
6969 local def=" ${2:- } "
70- local varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
71- local fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
70+ local varValue
71+ local fileVarValue
72+ varValue=$( env | grep -E " ^${var} =" | sed -E -e " s/^${var} =//" )
73+ fileVarValue=$( env | grep -E " ^${fileVar} =" | sed -E -e " s/^${fileVar} =//" )
7274 if [ -n " ${varValue} " ] && [ -n " ${fileVarValue} " ]; then
7375 echo >&2 " error: both $var and $fileVar are set (but are exclusive)"
7476 exit 1
@@ -80,7 +82,6 @@ file_env() {
8082 elif [ -n " ${def} " ]; then
8183 export " $var " =" $def "
8284 fi
83- unset " $fileVar "
8485}
8586
8687if expr " $1 " : " apache" 1> /dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187 rsync_options=" -rlD"
187188 fi
188189
190+ # shellcheck disable=SC2086
189191 rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192 for dir in config data custom_apps themes; do
191193 if [ ! -d " /var/www/html/$dir " ] || directory_empty " /var/www/html/$dir " ; then
194+ # shellcheck disable=SC2086
192195 rsync $rsync_options --include " /$dir /" --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
193196 fi
194197 done
198+ # shellcheck disable=SC2086
195199 rsync $rsync_options --include ' /version.php' --exclude ' /*' /usr/src/nextcloud/ /var/www/html/
196200
197201 # Install
You can’t perform that action at this time.
0 commit comments