From 7f1ccecfaaffcda4cfe11b315dbca0b899f4f8aa Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Thu, 21 May 2015 13:50:55 +0100 Subject: [PATCH] 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 Signed-off-by: David Sterba --- fsck.btrfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck.btrfs b/fsck.btrfs index f056a7f1..e1eff2ca 100755 --- a/fsck.btrfs +++ b/fsck.btrfs @@ -26,12 +26,13 @@ do a|A|p|y) AUTO=true;; esac done +shift $(($OPTIND - 1)) eval DEV=\${$#} if [ ! -e $DEV ]; then echo "$0: $DEV does not exist" exit 8 fi -if [ "$AUTO" == "false" ]; then +if ! $AUTO; then echo "If you wish to check the consistency of a BTRFS filesystem or" echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'." fi