]> git.pld-linux.org Git - packages/hdparm.git/blob - hdparm.init
- accept other block devices on Linux 2.6.x (ATA/SATA through libata in particular...
[packages/hdparm.git] / hdparm.init
1 #!/bin/sh
2
3 [ -f /etc/sysconfig/hdparm ] || exit 0
4
5 blockdevs=$(awk -F= '!/^#/ && !/^$/ {if ($2) print $1}' /etc/sysconfig/hdparm)
6 if [ -z "$blockdevs" ]; then
7         exit 0
8 fi
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 # Source hdparm configuration.
14 . /etc/sysconfig/hdparm
15
16 for var in $blockdevs; do
17         drive=${var#HDPARM_}
18         if [ -L "/proc/ide/${drive}" -o -d "/sys/block/${drive}" ]; then
19                 eval PARAMS=\$$var
20                 if [ -n "${PARAMS}" ]; then
21                         show "Setting parameters for drive %s (%s)" "$drive" "$PARAMS"
22                         busy
23                         /sbin/hdparm ${PARAMS} /dev/${drive}
24                         ok
25                 fi
26         fi
27 done
28
29 exit 0
This page took 0.117051 seconds and 3 git commands to generate.