]> git.pld-linux.org Git - packages/hdparm.git/blob - hdparm.init
742ed4fde7014366824bb15b2d71f9fde17c7d8a
[packages/hdparm.git] / hdparm.init
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
11 # Source function library
12 . /etc/rc.d/init.d/functions
13
14 # Get service config
15 [ -f /etc/sysconfig/hdparm ] && . /etc/sysconfig/hdparm
16
17
18 # See how we were called.
19 case "$1" in
20   start)
21         DRIVES=`cut -c 22- < /proc/partitions | egrep -v -e"md|name"`
22         for drive in $DRIVES; do
23                 eval PARAMS=\${HDPARM_${drive}}
24                 if [ -n "${PARAMS}" ] ; then
25                         show "Setting $drive parameters"
26                         busy
27                         /sbin/hdparm ${PARAMS} $drive
28                         deltext
29                         ok
30                 fi
31         done  
32         touch /var/lock/subsys/hdparm
33         ;;
34     stop)       
35         rm -f /var/lock/subsys/hdparm
36         ;;
37   status)
38         for drive in /dev/hd? ; do
39           hdparm $drive
40         done
41         ;;
42   *)
43         echo "Usage: $0 {start|stop|status}"
44         exit 1
45 esac
46
47 exit 0
This page took 0.023967 seconds and 2 git commands to generate.