More simplifications

Submitted by:	 Alex Kozlov
This commit is contained in:
imp 2010-10-22 00:11:55 +00:00
parent 4cd8e7cda9
commit 05dec1f02a
2 changed files with 7 additions and 23 deletions

View File

@ -26,25 +26,16 @@
# $FreeBSD$
# Query a disk for partitions and display them
#############################
#############################################################################
. ${PROGDIR}/backend/functions.sh
. ${PROGDIR}/backend/functions-disk.sh
if [ -z "${1}" ]
then
echo "Error: No disk specified!"
exit 1
fi
if [ ! -e "/dev/${1}" ]
then
echo "Error: Disk /dev/${1} does not exist!"
exit 1
fi
DISK="${1}"
[ -z "${DISK}" ] && { echo 'Error: No disk specified!'; exit 1; }
[ ! -e "/dev/${DISK}" ] && \
{ echo "Error: Disk /dev/${DISK} does not exist!"; exit 1; }
get_disk_cyl "${DISK}"
CYLS="${VAL}"

View File

@ -28,13 +28,6 @@
# Script which checks if we are running from install media, or real system
#############################################################################
dmesg | grep "md0: Preloaded image" >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
echo "INSTALL-MEDIA"
exit 0
else
echo "REAL-DISK"
exit 1
fi
dmesg | grep -q 'md0: Preloaded image' || { echo 'REAL-DISK'; exit 1; }
echo 'INSTALL-MEDIA'