mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 20:05:24 +00:00
btrfs-progs: fsck.btrfs: Fix bashism and bad getopts processing
First fix == bashism, as that is not accepted by e.g. Debian/Ubuntu dash. Secondly shift OPTIND, such that last parameter is checked to exist. Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
d6cedbcdd3
commit
7f1ccecfaa
@ -26,12 +26,13 @@ do
|
|||||||
a|A|p|y) AUTO=true;;
|
a|A|p|y) AUTO=true;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
shift $(($OPTIND - 1))
|
||||||
eval DEV=\${$#}
|
eval DEV=\${$#}
|
||||||
if [ ! -e $DEV ]; then
|
if [ ! -e $DEV ]; then
|
||||||
echo "$0: $DEV does not exist"
|
echo "$0: $DEV does not exist"
|
||||||
exit 8
|
exit 8
|
||||||
fi
|
fi
|
||||||
if [ "$AUTO" == "false" ]; then
|
if ! $AUTO; then
|
||||||
echo "If you wish to check the consistency of a BTRFS filesystem or"
|
echo "If you wish to check the consistency of a BTRFS filesystem or"
|
||||||
echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
|
echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user