]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
backup: Fix broken globbing expansion
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 29 Mar 2022 12:27:11 +0000 (12:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Mar 2022 13:43:25 +0000 (13:43 +0000)
This patch fixes globbing expansion in the backup include file list
which got broken in c7e0d73e7cfd7be95db9d0a5f3392b8241813d5b.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Tested-by: Bernhard Bitsch <bernhard.bitsch@ipfire.org>
config/backup/backup.pl

index a2337cf233034584cfc681149846347af738b00d..6f9295e94543d5901299ee16f02dddd3c5c578e6 100644 (file)
@@ -19,6 +19,8 @@
 #                                                                             #
 ###############################################################################
 
+shopt -s nullglob
+
 NOW="$(date "+%Y-%m-%d-%H:%M")"
 
 list_addons() {
@@ -38,10 +40,8 @@ process_includes() {
        for include in $@; do
                local file
                while read -r file; do
-                       for file in ${file}; do
-                               if [ -e "/${file}" ]; then
-                                       echo "${file}"
-                               fi
+                       for file in /${file}; do
+                               echo "${file}"
                        done
                done < "${include}"
        done | sort -u