From 99f60dd1bb530a4bd42c980c366619032f91a1c0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 6 Dec 2005 15:35:29 +0100 Subject: [PATCH] Self-exploitable version --- ccollect.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ccollect.sh b/ccollect.sh index 0bfa367..de5a851 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -22,7 +22,7 @@ CDEFAULTS=$CCOLLECT_CONF/defaults/ # usage() { - echo "$(basename $0): [args] " + echo "$(basename $0): [args] " echo "" echo " Nico Schottelius (nico-linux-ccollect schottelius.org) - 2005-12-06" echo "" @@ -30,6 +30,7 @@ usage() echo "" echo " -h, --help: Show this help screen" echo " -p, --parallel: Parellize backup process" + echo " -a, --all: Backup all sources specified in $CSOURCES" echo "" echo " http://linux.schottelius.org/ccollect/" echo "" @@ -75,6 +76,30 @@ while [ $i -le $# ]; do i=$((i+1)) done +# +# Look, if we should take ALL sources +# + +if [ "$ALL" = 1 ]; then + # reset everything specified before + no_shares=0 + + OLD_IFS=$IFS + export IFS=\\n + + for tmp in $(cd $CSOURCES/; ls); do + eval share_${no_shares}="$tmp" + no_shares=$((no_shares+1)) + echo \"-${tmp}-\" + done +fi + +# +# Need at least ONE source to backup +# +if [ "$no_shares" -lt 1 ]; then + usage +fi exit 1