1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2010-10-08 15:02:05 +00:00
parent 01143a9313
commit bd79af9f05
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.75 - Version 2.02.75 -
===================================== =====================================
Better support of noninteractive shell execution of fsadm.
Fix usage of --yes flag for ReiserFS resize in fsadm. Fix usage of --yes flag for ReiserFS resize in fsadm.
Fix detection of mounted filesystems for fsadm when udev is used. Fix detection of mounted filesystems for fsadm when udev is used.
Fix assignment of default value to LVM variable is fsadm. Fix assignment of default value to LVM variable is fsadm.

View File

@ -368,7 +368,11 @@ check() {
detect_mounted && error "Cannot fsck device \"$VOLUME\", filesystem is mounted on $MOUNTED" detect_mounted && error "Cannot fsck device \"$VOLUME\", filesystem is mounted on $MOUNTED"
case "$FSTYPE" in case "$FSTYPE" in
"xfs") dry $XFS_CHECK "$VOLUME" ;; "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 esac
} }