From a92d28db169c431b99b87adadeb7803864625265 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 7 Aug 2007 07:48:52 +0200 Subject: [PATCH] Add create source --- tools/create_source.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tools/create_source.sh diff --git a/tools/create_source.sh b/tools/create_source.sh new file mode 100644 index 0000000..92f2bc7 --- /dev/null +++ b/tools/create_source.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Nico Schottelius +# 2007-08-07 +# Written for Netstream (www.netstream.ch) +# Creates a source, including exclude + +if [ $# -ne 1 ]; then + echo $(basename $0): name + exit 1 +fi + +CCOLLECT_CONF=${CCOLLECT_CONF:-/etc/ccollect} +CSOURCES=$CCOLLECT_CONF/sources +CDEFAULTS=$CCOLLECT_CONF/defaults + +name="$1" +fullname="${CSOURCES}/${name}" + +if [ -e "${fullname}" ]; then + echo "${fullname} already exists. Aborting." + exit 2 +fi