summaryrefslogtreecommitdiff
path: root/files/concatfragments.sh
diff options
context:
space:
mode:
authormartin f. krafft <madduck@madduck.net>2010-10-04 23:02:32 +0200
committerR.I.Pienaar <rip@devco.net>2010-10-04 22:46:18 +0100
commitaf63a0b3eb0a528e39992e1f10c07d8a78a84e77 (patch)
tree926ce912d4be2089b4a7d0f8981a68356150f72c /files/concatfragments.sh
parent2a3abe58a633b7b635c57d690905af28b7273b93 (diff)
downloadpuppet-concat-af63a0b3eb0a528e39992e1f10c07d8a78a84e77.tar.gz
puppet-concat-af63a0b3eb0a528e39992e1f10c07d8a78a84e77.tar.bz2
Parametrize warning message
The concat warn parameter can now be any string (and needs to include the appropriate commenting character) and will then override the default (which still gets printed when warn=>true). Signed-off-by: martin f. krafft <madduck@madduck.net>
Diffstat (limited to 'files/concatfragments.sh')
-rw-r--r--[-rwxr-xr-x]files/concatfragments.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/files/concatfragments.sh b/files/concatfragments.sh
index 570853e..b486047 100755..100644
--- a/files/concatfragments.sh
+++ b/files/concatfragments.sh
@@ -47,12 +47,12 @@ SORTARG="-z"
PATH=/sbin:/usr/sbin:/bin:/usr/bin
-while getopts "o:s:d:tnwf" options; do
+while getopts "o:s:d:tnw:f" options; do
case $options in
o ) OUTFILE=$OPTARG;;
d ) WORKDIR=$OPTARG;;
n ) SORTARG="-zn";;
- w ) WARN="true";;
+ w ) WARNMSG="$OPTARG";;
f ) FORCE="true";;
t ) TEST="true";;
* ) echo "Specify output file with -o and fragments directory with -d"
@@ -101,10 +101,10 @@ fi
cd ${WORKDIR}
-if [ x${WARN} = "x" ]; then
- cat /dev/null > "fragments.concat"
+if [ x${WARNMSG} = "x" ]; then
+ : > "fragments.concat"
else
- echo '# This file is managed by Puppet. DO NOT EDIT.' > "fragments.concat"
+ echo -e "$WARNMSG" > "fragments.concat"
fi
# find all the files in the fragments directory, sort them numerically and concat to fragments.concat in the working dir