Magellan Linux

Contents of /trunk/hdparm/hdparm.rc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 723 - (show annotations) (download)
Mon Dec 22 22:42:18 2008 UTC (15 years, 4 months ago) by niro
File size: 763 byte(s)
-fixed moved rc

1 #!/bin/bash
2 # $Header: /root/magellan-cvs/src/hdparm/hdparm.rc,v 1.4 2008-12-22 22:34:06 niro Exp $
3
4 #%rlevels: 7:s
5 #%start: 54
6 #%stop:
7
8 #deps
9 #%needs:
10 #%before:
11 #%after:
12
13 source /etc/conf.d/rc
14 source $rc_functions
15
16 if [ ! -x /sbin/hdparm ]
17 then
18 echo "Please install sys-apps/hdparm"
19 exit 1
20 fi
21
22 if [ ! -f /etc/conf.d/hdparm ]
23 then
24 echo "/etc/conf.d/hdparm is missing ... "
25 exit 1
26 fi
27
28 (cat /etc/conf.d/hdparm; echo) | # make sure there is a LF at the end
29 while read disk args
30 do
31 case "${disk}" in
32 \#*|"") continue ;;
33 esac
34 echo -e ${COLOREDSTAR}"Setting hdd params ${COLBLUE}'${args}'${COLDEFAULT} for ${COLBLUE}${disk}${COLDEFAULT} ..."
35 hdparm ${args} ${disk} &> /dev/null
36 evaluate_retval
37 done
38
39 update_svcstatus $1
40 splash svc_started "$(basename $0)" 0