19403c8215c255ad357e5689a3c760b70d96714b
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / smartenabler
1 #!/bin/sh
2 # Begin $rc_base/init.d/smartenabler
3
4 . /etc/sysconfig/rc
5 . $rc_functions
6
7 case "$1" in
8 start)
9 boot_mesg -n "Enabling S.M.A.R.T.: ";
10 for disk in `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; do
11 /usr/sbin/smartctl -d ata --smart=on /dev/$disk > /dev/nul;
12 if [ ${?} = 0 ]; then
13 boot_mesg -n "$SUCCESS$disk$NORMAL ";
14 else
15 boot_mesg -n "$WARNING$disk$NORMAL ";
16 fi
17 done
18 boot_mesg;
19 echo_ok;
20 ;;
21
22 *)
23 echo "Usage: $0 {start}"
24 exit 1
25 ;;
26 esac
27
28 # End $rc_base/init.d/smartenabler