summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2011-01-29 17:26:22 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2011-01-29 17:26:22 +0100
commita51268e3b947a58e0808b0db249c1d08ac6f44a9 (patch)
treec1a3dc4cafa3fb592221734763fa3b19c728bb2d
parent3f0533709b77979025c0c5bca64327e924935b19 (diff)
when using nullglob for specific sections, return to default bash behavior again afterwards
-rwxr-xr-xsrc/aif-report-issues.sh1
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh4
-rwxr-xr-xsrc/core/libs/lib-flowcontrol.sh1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/aif-report-issues.sh b/src/aif-report-issues.sh
index 5ed18f4..06be8c8 100755
--- a/src/aif-report-issues.sh
+++ b/src/aif-report-issues.sh
@@ -31,6 +31,7 @@ then
bin=${bin/ /} # for some reason there is a space in the beginning
report="$report\n$i $bin"
done
+ shopt -u nullglob
fi
echo "It can also be useful to upload a list of currently mounted filesystems:"
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index d00ef81..bcde961 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -257,10 +257,11 @@ findblockdevices() {
disk=$(basename $devpath)
echo -ne "/dev/$disk $1"
cd /sys/block/$disk
+ shopt -s nullglob
for part in $disk*
do
# check if not already assembled to a raid device. TODO: what is the significance of the 5? ASKDEV
- if ! grep -q $part /proc/mdstat 2>/dev/null && ! fstype 2>/dev/null </dev/$part | grep -q lvm2 && ! sfdisk -c /dev/$disk $(echo $part | sed -e "s#$disk##g") 2>/dev/null | grep -q '5'
+ if [ -n "$part" ] && ! grep -q $part /proc/mdstat 2>/dev/null && ! fstype 2>/dev/null </dev/$part | grep -q lvm2 && ! sfdisk -c /dev/$disk $(echo $part | sed -e "s#$disk##g") 2>/dev/null | grep -q '5'
then
if [ -d $part ]
then
@@ -268,6 +269,7 @@ findblockdevices() {
fi
fi
done
+ shopt -u nullglob
done
# mapped devices
for devpath in $(ls /dev/mapper 2>/dev/null | grep -v control)
diff --git a/src/core/libs/lib-flowcontrol.sh b/src/core/libs/lib-flowcontrol.sh
index b9830b0..4f3bbfa 100755
--- a/src/core/libs/lib-flowcontrol.sh
+++ b/src/core/libs/lib-flowcontrol.sh
@@ -45,6 +45,7 @@ load_module ()
module=$(basename "$module")
load_${submodule} "$1" "$module"
done
+ shopt -u nullglob
fi
done