#!/bin/sh -e # Copyright (C) 2005, 2008 Joost van Baal # # This file is part of systraq. Systraq is free software; you can redistribute # it and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the License, # or (at your option) any later version. You should have received a copy of # the GNU General Public License along with this file (see COPYING). # st_snapshot.hourly - wrapper for st_snapshot, to be run from cron test -f /etc/systraq/i_want_a_broken_systraq && exit 0 if test -f /etc/systraq/systraq_is_unconfigured then cat /etc/systraq/systraq_is_unconfigured exit 0 fi if test -f /etc/systraq/systraq_is_not_upgraded then cat /etc/systraq/systraq_is_not_upgraded exit 0 fi if test -n "$ST_SUM" then # user has set ST_SUM, honor that one : elif command -v sha256sum >/dev/null then ST_SUM=sha256sum elif command -v md5sum >/dev/null then cat < \ /var/lib/systraq/snapshot_root.stat else for f in /etc/systraq/snapshot_pub.list /etc/systraq/snapshot_pub.homelist do if test ! -f $f then echo File $f does not exist. Please create it. echo See the Systraq Manual in /usr/share/doc/systraq for instructions. exit 1 fi done ST_OPHOMES=yes st_snapshot /etc/systraq/snapshot_pub.list \ /etc/systraq/snapshot_pub.homelist > /var/lib/systraq/snapshot_pub.stat fi