]> git.pld-linux.org Git - packages/hdparm.git/blame - hdparm.init
- devfs support
[packages/hdparm.git] / hdparm.init
CommitLineData
18b351a9 1#!/bin/sh
3672489f 2
3# Source function library
18b351a9
JK
4. /etc/rc.d/init.d/functions
5
3672489f 6# Get service config
7[ -f /etc/sysconfig/hdparm ] && . /etc/sysconfig/hdparm
18b351a9 8
c0a499f5
AM
9if [ -c /dev/.devfsd ]; then
10 # we have devfs enabled kernel
11 DRIVES=$(ls -1 /dev/hd* /dev/sd* 2> /dev/null | \
12 awk -F'/' ' ! /[0-9]$/ { print $3; }')
13else
14 DRIVES="`awk '!($NF ~ /md|name/) { print $NF }' /proc/partitions`"
15fi
16
0575f91b 17for drive in $DRIVES; do
c0a499f5 18 eval PARAMS=\$HDPARM_${drive}
0575f91b
SZ
19 if [ -n "${PARAMS}" ] ; then
20 show "Setting parameters for drive %s" "$drive"
21 busy
22 /sbin/hdparm ${PARAMS} /dev/$drive
23 deltext
24 ok
25 fi
26done
18b351a9 27exit 0
This page took 0.119954 seconds and 4 git commands to generate.