#! /bin/sh head() { cat < $line" done head "End of $1" fi } install() { size=$1 dsize=$2 umount /boot rm -f /tmp/newpart* /tmp/fdisk* head "Size: $size" cat < /dev/null a $size $dsize JA EOF head "fdisk commands" cat /tmp/newpart* # head "fdisk output" # cat /tmp/fdisk* { fdisk /dev/hda < /tmp/cmd df -h } | head "Results for $size" loop } if [ "$OPT_HDINSTALL_TEST" = yes ]; then begin_script HDINSTALL_TEST "running hd install tests" echo -e "p\nq" > /tmp/cmd exec 2> /tmp/hdinstall.log for i in $HDIT_SIZES; do install $i $HDIT_DATA done head "Log: " cat /tmp/hdinstall.log [ "$HDIT_POWEROFF" = 'yes' ] && poweroff end_script fi