From ddc3eda2684cda6e85f3e55b23864a4e864ec253 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 23 Apr 2015 18:12:28 +0200 Subject: [PATCH] New script 94-update-smart-drivedb to update smartmontools' drive database --- .../scripts/GRMLBASE/94-update-smart-drivedb | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 etc/grml/fai/config/scripts/GRMLBASE/94-update-smart-drivedb diff --git a/etc/grml/fai/config/scripts/GRMLBASE/94-update-smart-drivedb b/etc/grml/fai/config/scripts/GRMLBASE/94-update-smart-drivedb new file mode 100755 index 0000000..3baa757 --- /dev/null +++ b/etc/grml/fai/config/scripts/GRMLBASE/94-update-smart-drivedb @@ -0,0 +1,32 @@ +#!/bin/bash +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/94-update-smart-drivedb +# Purpose: update pciids +# Authors: (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +################################################################################ + +if ifclass NO_ONLINE ; then + echo "Ignoring script 94-update-smart-drivedb as NO_ONLINE is set." + exit 0 +fi + +set -u +set -e + +[ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" + +if ! [ -x ${target}/usr/sbin/update-smart-drivedb ] ; then + echo "Warning: smartmontools not installed" + exit 0 +fi + +echo "Updating smartmontool drivedb" +if [ -n "$TIMEOUT" ] ; then + $ROOTCMD timeout $TIMEOUT update-smart-drivedb +else + $ROOTCMD update-smart-drivedb +fi + +## END OF FILE ################################################################# +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2 -- 2.1.4