diff options
Diffstat (limited to 'sysutils/smartmontools-devel/files/smart.in')
-rw-r--r-- | sysutils/smartmontools-devel/files/smart.in | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sysutils/smartmontools-devel/files/smart.in b/sysutils/smartmontools-devel/files/smart.in deleted file mode 100644 index d4ba696d5212..000000000000 --- a/sysutils/smartmontools-devel/files/smart.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# This script is in the public domain. Original author: Garrett Wollman -# -# $FreeBSD$ -# - -if [ -r /etc/defaults/periodic.conf ]; then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -smartctl=%%PREFIX%%/sbin/smartctl -: ${daily_status_smartctl_flags="-H"} -: ${daily_status_smartctl_extra_status_flags="-a"} - -case "${daily_status_smart_devices}" in - # XXX AUTO mode selects only regular ad/da disks - [Aa][Uu][Tt][Oo]) - daily_status_smart_devices=`sysctl -n kern.disks` - ;; - *) ;; -esac - -if [ -z "${daily_status_smart_devices}" ]; then - : ${daily_status_smart_enable="NO"} -else - : ${daily_status_smart_enable="YES"} -fi - -trim_junk="tail -n +4" - -tmpfile="$(mktemp /var/run/daily.XXXXXXXX)" -trap "rm -f ${tmpfile}" 0 1 3 15 - -rc=0 -case "${daily_status_smart_enable}" in - [Yy][Ee][Ss]) - cd /dev - for device in ${daily_status_smart_devices}; do - if [ -e ${device} ]; then - echo - echo "Checking health of ${device}:" - echo - ${smartctl} ${daily_status_smartctl_flags} ${device} > "${tmpfile}" - status=$? - if [ $((status & 3)) -ne 0 ]; then - rc=2 - ${trim_junk} "${tmpfile}" - elif [ $status -ne 0 ]; then - rc=1 - ${smartctl} ${daily_status_smartctl_extra_status_flags} ${device} | ${trim_junk} - else - ${trim_junk} "${tmpfile}" - fi - fi - done - ;; -esac - -exit "$rc" |