remakesd

Change of makesd-common

7:4135f638972c
makesd-common
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/makesd-common	Sat May 25 01:19:21 2019 +0200
     1.3 @@ -0,0 +1,33 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +# Common routines.
     1.7 +
     1.8 +# Test for a selected device.
     1.9 +
    1.10 +check_device()
    1.11 +{
    1.12 +    if [ ! "$DEV" ] ; then
    1.13 +        cat 1>&2 <<EOF
    1.14 +No device specified. Use the DEV environment variable to indicate a device.
    1.15 +EOF
    1.16 +        exit 1
    1.17 +    fi
    1.18 +
    1.19 +    if [ ! -e "$DEV" ] ; then
    1.20 +        cat 1>&2 <<EOF
    1.21 +Device not found: $DEV
    1.22 +EOF
    1.23 +        exit 1
    1.24 +    fi
    1.25 +}
    1.26 +
    1.27 +# Process partition field values in summary tables.
    1.28 +
    1.29 +read_fields()
    1.30 +{
    1.31 +    OLDIFS=$IFS
    1.32 +    IFS=`echo -n '\t'` read START SIZE TYPE
    1.33 +    STATUS=$?
    1.34 +    IFS=$OLDIFS
    1.35 +    return $STATUS
    1.36 +}