fixing sbin compatibility issue
authorFlorian Klien <flowolf@klienux.org>
Thu, 6 Sep 2012 13:42:41 +0000 (15:42 +0200)
committerFlorian Klien <flowolf@klienux.org>
Thu, 6 Sep 2012 14:02:08 +0000 (16:02 +0200)
other distributions might locate mkfs.vfat in a different location
than /sbin. e.g: gentoo installs dosfstools to /usr/sbin

grml-crypt

index 8fbe04d..6a4cd70 100755 (executable)
@@ -427,8 +427,8 @@ if (( $OPTIMIZING_LEVEL_ > 1 )); then
 fi
 TARGET_="$2"
 
-MKFS_="/sbin/mkfs.$FSTYPE_"
-if [ ! -x "$MKFS_" ]; then
+MKFS_="`which mkfs.$FSTYPE_`"
+if [ $? != "0" ]; then
   die "invalid filesystem type \"$FSTYPE_\"" 1
 fi