]> git.pld-linux.org Git - packages/hdparm.git/blame - hdparm.init
- added using CVS keywords in %changelog (for automating them).
[packages/hdparm.git] / hdparm.init
CommitLineData
18b351a9
JK
1#!/bin/sh
2#
3# hdpram Sets up some hard drive parameters
4#
5#
6# chkconfig: 2345 5 95
7# description: hdparm is utility which can help tuning your hard drive\
8# parameters
9
10# Source function library.
11. /etc/rc.d/init.d/functions
12
13[ -x /sbin/hdparm ] || exit 0
14[ -f /etc/sysconfig/hdparm ] || exit 0
15
16. /etc/sysconfig/hdparm
17
18# See how we were called.
19case "$1" in
20 start)
21 cd /dev
41c68f0a
JK
22 DRIVES=`cut -c 22- < /proc/partitions | egrep -v -e"md|name"`
23 for drive in $DRIVES ; do
18b351a9
JK
24 eval PARAMS=\${HDPARM_${drive}}
25 if [ -n "${PARAMS}" ] ; then
26 show "Setting $drive parameters"
27 busy
28 /sbin/hdparm ${PARAMS} $drive
29 deltext
30 ok
31 fi
32 done
33 touch /var/lock/subsys/hdparm
34 ;;
35 stop)
36 rm -f /var/lock/subsys/hdparm
37 ;;
38 status)
39 for drive in /dev/hd? ; do
40 hdparm $drive
41 done
42 ;;
43 *)
44 echo "Usage: $0 {start|stop|status}"
45 exit 1
46esac
47
48exit 0
This page took 0.061301 seconds and 4 git commands to generate.