diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2005-04-27 21:27:06 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2005-04-27 21:27:06 +0000 |
commit | a84f86e9e1b48ce9bf38494e4b386096cf353e11 (patch) | |
tree | 7576072bcf33da33fbf3198ce510f1cfac253bd1 /sysutils | |
parent | 1b0050f0c6ad81857d9c6ac3e99898e2e39204f4 (diff) | |
download | ports-a84f86e9e1b48ce9bf38494e4b386096cf353e11.tar.gz ports-a84f86e9e1b48ce9bf38494e4b386096cf353e11.zip |
Notes
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 413af02c98f1..eeaae84b80cf 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 ed7f9f92a44f..a0c413bde8b5 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 |