From 0294c76313c7cf21a997b012933fc7f0d9e1b693 Mon Sep 17 00:00:00 2001 From: Thomas Koehler Date: Thu, 10 Nov 2011 17:45:43 +0100 Subject: [PATCH 3/3] remove -F "third time" logic, add -X instead --- grml-crypt | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/grml-crypt b/grml-crypt index 8ed9249..5bcd12e 100755 --- a/grml-crypt +++ b/grml-crypt @@ -70,8 +70,8 @@ OPTIONS: -f force file overwriting in format mode and/or disable confirmation dialog -F only for action start: run fsck before mounting the filesystem. Use fsck's -f option if given twice. - Read next argument as a list of options to pass to fsck if given three times: - 'grml-crypt -FFF "-y -T" start /dev/ice' will run fsck with options -y and -T. + -X Read next argument as a list of options to pass to fsck: + 'grml-crypt -FF -X "-y -T" start /dev/ice' will run fsck with options -y and -T. -m additional arguments to mount -v verbose (show what is going on, v++) -h this help text @@ -196,7 +196,7 @@ function actionStart execute "$CRYPTSETUP_ $cargs_ luksOpen $TARGET_ $DM_NAME_" warn || execute "losetup -d $TARGET_" || \ die "could not luksOpen $TARGET_" if [[ "$FSCK_" == "true" ]] ; then - execute "fsck -C $DM_PATH_" || die "fsck failed on $DM_PATH_" + execute "fsck $FSCK_EXTRA_OPTS_ -C $DM_PATH_" || die "fsck failed on $DM_PATH_" elif [[ "$FSCK_" == "trueforce" ]] ; then execute "fsck -f $FSCK_EXTRA_OPTS_ -C $DM_PATH_" || die "fsck failed on $DM_PATH_" fi @@ -378,7 +378,7 @@ function actionFormat ### __MAIN ### -while getopts "s:t:rzoyfFm:hvS:C:I:A:" opt; do +while getopts "s:t:rzoyfFm:hvS:C:I:A:X:" opt; do case "$opt" in s) SIZE_="$OPTARG"; SIZE_SET_='true' ;; t) FSTYPE_="$OPTARG" ;; @@ -393,14 +393,10 @@ while getopts "s:t:rzoyfFm:hvS:C:I:A:" opt; do F) if [[ "$FSCK_" == "true" ]] ; then FSCK_='trueforce' else - if [[ "$FSCK_" == "trueforce" ]] ; then - eval "FSCK_EXTRA_OPTS_=\"\$$OPTIND\"" - shift - else - FSCK_='true' - fi + FSCK_='true' fi ;; + X) FSCK_EXTRA_OPTS_="$OPTARG" ;; m) ADDITIONAL_MOUNT_ARGS_="$OPTARG" ;; h) printUsage; exit ;; v) let verbose_=$verbose_+1 ;; -- 1.7.2.3