diff options
author | brooks <brooks@FreeBSD.org> | 2005-04-27 21:27:06 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-04-27 21:27:06 +0000 |
commit | 9a3ca2becedfd7336b94d22f7d6b343e365347be (patch) | |
tree | 9225265786754041f2507bc2cb13c02b4b940883 /sysutils | |
parent | 678c36a2f985b596eb4f1b3c7f3f40e6d4d6d26e (diff) | |
download | FreeBSD-ports-9a3ca2becedfd7336b94d22f7d6b343e365347be.zip FreeBSD-ports-9a3ca2becedfd7336b94d22f7d6b343e365347be.tar.gz |
Add a -q option to gmetasnap to suppress non-error output.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/ganglia-monitor-core/Makefile | 2 | ||||
-rw-r--r-- | sysutils/ganglia-monitor-core/files/gmetasnap.sh | 27 |
2 files changed, 21 insertions, 8 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile index 413af02..eeaae84 100644 --- a/sysutils/ganglia-monitor-core/Makefile +++ b/sysutils/ganglia-monitor-core/Makefile @@ -7,7 +7,7 @@ PORTNAME= monitor-core PORTVERSION= 3.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils net parallel .if !defined(PORTDEV) MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} diff --git a/sysutils/ganglia-monitor-core/files/gmetasnap.sh b/sysutils/ganglia-monitor-core/files/gmetasnap.sh index ed7f9f9..a0c413b 100644 --- a/sysutils/ganglia-monitor-core/files/gmetasnap.sh +++ b/sysutils/ganglia-monitor-core/files/gmetasnap.sh @@ -16,6 +16,7 @@ snapdir=$def_snapdir snapname=$def_snapname comp=$def_comp delete_old=0 +quiet=0 usage() { @@ -32,6 +33,7 @@ usage: options: -D Delete .old file after creating snapshot. -h Display this message + -q Avoid output unless there is an error. -r <rrddir> Set the rrddir [default: ${def_rrddir}] -s <snapdir> Set the snapdir [default: ${def_snapdir}] -z <comptype> Set the compression type. Valid values are @@ -57,6 +59,13 @@ warn() echo ${command} $* >&2 } +status() +{ + if [ $quiet -eq 0 ]; then + echo $* + fi +} + compsuffix() { case "$1" in @@ -98,15 +107,19 @@ compflag() while [ -n "$1" ]; do case "$1" in -D) - shift; + shift delete_old=1 ;; -h) - shift; + shift usage 0 ;; + -q) + shift + quiet=1 + ;; -r) - shift; + shift if [ -z "$1" ]; then usage 1 "-r requires an argument" fi @@ -114,7 +127,7 @@ while [ -n "$1" ]; do shift ;; -s) - shift; + shift if [ -z "$1" ]; then usage 1 "-s requires an argument" fi @@ -122,7 +135,7 @@ while [ -n "$1" ]; do shift ;; -z) - shift; + shift if [ -z "$1" ]; then usage 1 "-z requires an argument" fi @@ -152,7 +165,7 @@ save) if [ ! -d ${snapdir} ]; then err 2 "snapdir ${snapdir} does not exist" fi - echo "saving ${rrddir} to ${basefile}" + status "saving ${rrddir} to ${basefile}" cd ${rrddir} if ! ${tarcmd}cf ${basefile}.new .; then err 2 "Failed to create ${basefile}.new" @@ -182,7 +195,7 @@ restore) if [ -z "$sourcefile" ]; then err 1 "no snapshot found in ${snapdir}." fi - echo "restoring ${rrddir} from ${sourcefile}" + status "restoring ${rrddir} from ${sourcefile}" if [ ! -d "${rrddir}" ]; then err 1 "${rrddir} does not exist" fi |