Skip to content

Commit 7f1ccec

Browse files
Dimitri John Ledkovkdave
Dimitri John Ledkov
authored andcommitted
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 <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d6cedbc commit 7f1ccec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fsck.btrfs

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ do
2626
a|A|p|y) AUTO=true;;
2727
esac
2828
done
29+
shift $(($OPTIND - 1))
2930
eval DEV=\${$#}
3031
if [ ! -e $DEV ]; then
3132
echo "$0: $DEV does not exist"
3233
exit 8
3334
fi
34-
if [ "$AUTO" == "false" ]; then
35+
if ! $AUTO; then
3536
echo "If you wish to check the consistency of a BTRFS filesystem or"
3637
echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
3738
fi

0 commit comments

Comments
 (0)