summaryrefslogtreecommitdiffstats
path: root/bin/do-diffs.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/do-diffs.in')
-rwxr-xr-xbin/do-diffs.in33
1 files changed, 31 insertions, 2 deletions
diff --git a/bin/do-diffs.in b/bin/do-diffs.in
index 940203f..a8d4800 100755
--- a/bin/do-diffs.in
+++ b/bin/do-diffs.in
@@ -21,6 +21,32 @@ ENVFILE="`dirname $0`/env"
TMPDIR=${TMPDIR:=/tmp}; export TMPDIR
+# command-line options
+# -r <device name>
+if [ $# -ge 1 ] ; then
+
+ while [ 1 ] ; do
+ case $1 in
+ -r)
+ shift
+ # next arg is the device name
+ device="$1"
+ shift
+ ;;
+ --)
+ shift; break;
+ ;;
+ -*)
+ echo "unknown option: $1" >&2
+ exit 1
+ ;;
+ *)
+ break;
+ ;;
+ esac
+ done
+fi
+
if [ $# -ge 1 ] ; then
LIST_OF_GROUPS="$*"; export LIST_OF_GROUPS
elif [ "$LIST_OF_GROUPS" = "" ] ; then
@@ -32,7 +58,6 @@ if [ ! -d $BASEDIR/logs ] ; then
mkdir $BASEDIR/logs
fi
-
for GROUP in $LIST_OF_GROUPS
do
@@ -72,7 +97,11 @@ END
trap 'rm -fr $LOCKFILE;exit 1' 1 2 3 6 10 15
touch $LOCKFILE
if [ $? -eq 0 ] ; then
- control_rancid $GROUP
+ if [ "X$device" = "X" ] ; then
+ control_rancid $GROUP
+ else
+ control_rancid -r $device $GROUP
+ fi
rm -f $LOCKFILE
fi
trap '' 1 2 3 6 10 15