#!/bin/sh

# name        : hdsetup
# author      : Matthias Grimm <matthiasgrimm@users.sourceforge.net>
# description : Set harddisk spin-down timeouts
# requirements: hdparm and sync in path
# limitations : work only with IDE harddisks
#               controls only a single harddisk
#
# --- end of public part -- don't change below this line ---

# source configuration
. pmcs-config

case "$1" in
  powersave)
    for HD in $general_HDDevice; do
       hdparm $powersave_HDOptions -S $(($powersave_HDTimeOff/5)) $HD
    done
    ;;
  custom)
    for HD in $general_HDDevice; do
       hdparm $custom_HDOptions -S $(($custom_HDTimeOff/5)) $HD
    done
    ;;
  performance)
    for HD in $general_HDDevice; do
       hdparm $performance_HDOptions -S $(($performance_HDTimeOff/5)) $HD
    done
    ;;
  suspend)
    sync
    ;;
  resume)
    ;;
esac

