SOURCES: vnstat-report (NEW) - new
adamg
adamg at pld-linux.org
Sun Apr 6 00:18:04 CEST 2008
Author: adamg Date: Sat Apr 5 22:18:04 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- new
---- Files affected:
SOURCES:
vnstat-report (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/vnstat-report
diff -u /dev/null SOURCES/vnstat-report:1.1
--- /dev/null Sun Apr 6 00:18:04 2008
+++ SOURCES/vnstat-report Sun Apr 6 00:17:58 2008
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. /etc/rc.d/init.d/functions
+
+if [ ! -f /etc/sysconfig/vnstat ]; then
+ echo "/etc/sysconfig/vnstat missing";
+ exit 1
+fi;
+
+. /etc/sysconfig/vnstat
+
+# quit if we are told not to send reports
+if ! is_yes "${VNSTAT_SEND_DAILY_REPORT}"; then
+ exit
+fi
+
+(
+cat <<EOF
+To: ${VNSTAT_EMAIL}
+Subject: vnStat daily report
+
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+Summary:
+
+$(/usr/bin/vnstat)
+
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+Detailed statistics:
+
+$(/usr/bin/vnstat --hours)
+EOF
+) | ${SENDMAIL} ${SENDMAIL_OPTIONS}
================================================================
More information about the pld-cvs-commit
mailing list