#!/bin/sh

OLD=$(cat /tmp/ide0.interrupts 2>&-)
NEW=$(sed -ne's/.*: *\([0-9]\+\).*ide0$/\1/p' /proc/interrupts)
echo $NEW>/tmp/ide0.interrupts
test "$OLD" = "$NEW" && hdparm -y /dev/hda
