Remplacement "grep 1> /dev/null 2>&1" par "grep -q"
[hvlinux.git] / stage2 / hv-utilities / media-write
index 1f83ab9..e66dba6 100755 (executable)
@@ -14,15 +14,15 @@ GROWISOFS_OPTS="-dvd-compat"
 # Try to read ATIP infos for CD disks to estimate capacity...
 MEDIA_ATIP_INFOS=$(cdrecord dev=${MEDIA_DEV} -atip 2>&1)
 
-if echo ${MEDIA_ATIP_INFOS} | grep "ATIP info from disk" 1> /dev/null 2>&1; then
+if echo ${MEDIA_ATIP_INFOS} | grep -q "ATIP info from disk"; then
     MEDIA_SIZE=${CD_MEDIA_SIZE}
     MEDIA_TYPE="CD"
     echo "CD disk detected"
-elif echo ${MEDIA_ATIP_INFOS} | grep "Found DVD media but" 1> /dev/null 2>&1; then
+elif echo ${MEDIA_ATIP_INFOS} | grep -q "Found DVD media but"; then
     MEDIA_SIZE=${DVD_MEDIA_SIZE}
     MEDIA_TYPE="DVD"
     echo "DVD disk detected"
-elif echo ${MEDIA_ATIP_INFOS} | grep "cdrecord: No disk / Wrong disk" 1> /dev/null 2>&1; then
+elif echo ${MEDIA_ATIP_INFOS} | grep -q "cdrecord: No disk / Wrong disk"; then
     echo "No disk inserted, aborting"
     exit 1
 else
@@ -142,7 +142,7 @@ case "${MEDIA_TYPE}" in
 esac
 
 # Mounting the media to verify burned capacity
-if ! grep ${MEDIA_DEV} /etc/mtab 1> /dev/null 2>&1; then
+if ! grep -q ${MEDIA_DEV} /etc/mtab; then
     mount ${MEDIA_DEV} ${MEDIA_DIR} || exit 1
 fi