X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mbr_dump.sh;h=d97e450353b57cdf163d81f973563ae21d2d7a1a;hb=ef32118a10785fe6792d3bad1d4b11590460bffe;hp=dce79628d02b307e4847971a7dbe9613b015eabf;hpb=e915a0738a5e314ed9282674f8bbc07325388d5a;p=cmccabe-bin diff --git a/mbr_dump.sh b/mbr_dump.sh index dce7962..d97e450 100755 --- a/mbr_dump.sh +++ b/mbr_dump.sh @@ -6,14 +6,22 @@ # # Colin McCabe # +usage() { + echo "usage: ${0} " + echo "should be 512 bytes in length." + exit 1 +} + +if [ $# -ne 1 ]; then + usage +fi if [ -e ${1} ]; then PART_FILE=${1} else - echo "usage: ${0} " - echo "should be 512 bytes in length." - exit 1 + usage fi + echo "# first partition" od -j 446 -N 16 -t x1 ${1} echo "# second partition"