#! /bin/sh
# /etc/r2d2/hardware/harddisks - configure the harddisks of your system
#
# Copyright Winfried Tr\374mper <winni@xpilot.org> 1996,1997. All rights reserved.
# This file is part of the r2d2 init concept.
#

$DISKS_CFG="/etc/hardware/harddisks.conf"


while read DEVICE IDLE OPTIONS
do
      # ignore comments and blank lines
    case "$IF" in
        "\#*" | "") continue ;;
    esac

    case ${DEVICE##/dev/} in
	hd*)
	    if [ "$IDLE" != "" ]
	    then
		OPTIONS="$OPTIONS -S $IDLE"
	    fi
	    hdparm $OPTIONS $DEVICE
	;;
	sd*)
	    if [ "$IDLE" != "" ]
	    then
		scsiidle $DEVICE $IDLE
	    fi
	    hdparm $OPTIONS $DEVICE
	;;
    esac
done < $DISKS_CFG

echo "done."

exit 0

