From bd79af9f050bca534911ae37fc8cb2ba124cee61 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 8 Oct 2010 15:02:05 +0000 Subject: [PATCH] Add support for noninterctive shell execution Try to distinguish between the case of using interactive shell and non interactive running - different combinations of '-y' and '-p' option needs to be used for fsck. --- WHATS_NEW | 1 + scripts/fsadm.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index b080742f3..093fd40eb 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.75 - ===================================== + Better support of noninteractive shell execution of fsadm. Fix usage of --yes flag for ReiserFS resize in fsadm. Fix detection of mounted filesystems for fsadm when udev is used. Fix assignment of default value to LVM variable is fsadm. diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh index 7449b3343..c1e8fb182 100644 --- a/scripts/fsadm.sh +++ b/scripts/fsadm.sh @@ -368,7 +368,11 @@ check() { detect_mounted && error "Cannot fsck device \"$VOLUME\", filesystem is mounted on $MOUNTED" case "$FSTYPE" in "xfs") dry $XFS_CHECK "$VOLUME" ;; - *) dry $FSCK $YES "$VOLUME" ;; + *) # check if executed from interactive shell environment + case "$-" in + *i*) dry $FSCK $YES $FORCE "$VOLUME" ;; + *) dry $FSCK $FORCE -p "$VOLUME" ;; + esac esac } -- 2.43.5