diff options
| author | Warner Losh <imp@FreeBSD.org> | 2010-10-22 00:11:55 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2010-10-22 00:11:55 +0000 |
| commit | 56f8b30888f0bf74e64a19edc222fe6a31881a70 (patch) | |
| tree | b947996dd38f31ba5a1c6037ab060254b68d9e00 /usr.sbin/pc-sysinstall | |
| parent | f1bed2243782cb677f8948fd942f1a3e111a7736 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pc-sysinstall')
| -rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/disk-info.sh | 19 | ||||
| -rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/test-live.sh | 11 |
2 files changed, 7 insertions, 23 deletions
diff --git a/usr.sbin/pc-sysinstall/backend-query/disk-info.sh b/usr.sbin/pc-sysinstall/backend-query/disk-info.sh index 222e8c5423cd..8c55fce7142e 100755 --- a/usr.sbin/pc-sysinstall/backend-query/disk-info.sh +++ b/usr.sbin/pc-sysinstall/backend-query/disk-info.sh @@ -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}" diff --git a/usr.sbin/pc-sysinstall/backend-query/test-live.sh b/usr.sbin/pc-sysinstall/backend-query/test-live.sh index b48c2eecf3af..86acc30705cf 100755 --- a/usr.sbin/pc-sysinstall/backend-query/test-live.sh +++ b/usr.sbin/pc-sysinstall/backend-query/test-live.sh @@ -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' |
