Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 96ea0c0434263bff96b544bc4e7c57a2 > files > 22

gsmartcontrol-0.8.4-2mdv2010.0.i586.rpm

#!/bin/bash
############################################################################
# Copyright:
#      (C) 2008 - 2009  Alex Butcher <alex dot butcher 'at' assursys.co.uk>
#      (C) 2008 - 2009  Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_whatever.txt file
############################################################################

device="$1";

if [ "$device" = "" ]; then
	echo "Usage: $0 <device>"
	exit 1;
fi

dev_base="`basename \"$device\"`"
out_file=/var/run/smart-"$dev_base"

# Change the path to smartctl if necessary.
smartctl -a "$device" 2>&1 > "$out_file"

chmod 644 "$out_file"