summaryrefslogtreecommitdiffstats
path: root/dracut
diff options
context:
space:
mode:
authorSören Tempel <[email protected]>2015-02-10 20:12:13 +0100
committerBrian Behlendorf <[email protected]>2015-02-13 15:58:18 -0800
commitcfbaa3c830e34b1c8920a48fd5e7196287f674eb (patch)
tree01f56d86151676e963a03ddabde2e03817adac03 /dracut
parente02b533e746403743297020591e4b80d614a3aae (diff)
Use test(1) in a proper way
Use the correct operators to check the expected data type. Signed-off-by: Soeren Tempel <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #3093
Diffstat (limited to 'dracut')
-rwxr-xr-xdracut/90zfs/mount-zfs.sh.in4
-rwxr-xr-xdracut/90zfs/parse-zfs.sh.in2
2 files changed, 3 insertions, 3 deletions
diff --git a/dracut/90zfs/mount-zfs.sh.in b/dracut/90zfs/mount-zfs.sh.in
index 1fb4ea537..ffc3f2013 100755
--- a/dracut/90zfs/mount-zfs.sh.in
+++ b/dracut/90zfs/mount-zfs.sh.in
@@ -22,13 +22,13 @@ case "$root" in
# Might be imported by the kernel module, so try searching before
# we import anything.
zfsbootfs=`zpool list -H -o bootfs | sed -n '/^-$/ !p' | sed 'q'`
- if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
+ if [ $? -ne 0 ] || [ -z "$zfsbootfs" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then
# Not there, so we need to import everything.
info "ZFS: Attempting to import additional pools."
zpool import -N -a ${ZPOOL_FORCE}
zfsbootfs=`zpool list -H -o bootfs | sed -n '/^-$/ !p' | sed 'q'`
- if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
+ if [ $? -ne 0 ] || [ -z "$zfsbootfs" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then
rootok=0
pool=""
diff --git a/dracut/90zfs/parse-zfs.sh.in b/dracut/90zfs/parse-zfs.sh.in
index 571d263ce..f945a27c1 100755
--- a/dracut/90zfs/parse-zfs.sh.in
+++ b/dracut/90zfs/parse-zfs.sh.in
@@ -52,7 +52,7 @@ esac
# Make sure Dracut is happy that we have a root and will wait for ZFS
# modules to settle before mounting.
-if [ "${wait_for_zfs}" = "1" ]; then
+if [ ${wait_for_zfs} -eq 1 ]; then
ln -s /dev/null /dev/root 2>/dev/null
echo '[ -e /dev/zfs ]' > $hookdir/initqueue/finished/zfs.sh
fi