diff options
author | Tar Committer <tar@ocjtech.us> | 2005-03-30 07:52:00 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2005-03-30 07:52:00 +0000 |
commit | 4d684aecaacc9a59e7e9c0661934aeba0b16efec (patch) | |
tree | 84adf7c191abe898368aa09c6b3592f40250a42c /bin/rancid-run.in | |
parent | 654a4573f8fd2b1109e0ded8d9ce061dd3a2093f (diff) | |
download | rancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.tar.gz rancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.tar.xz rancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.zip |
Imported from rancid-2.3.2a.tar.gz.rancid-2.3.2a
Diffstat (limited to 'bin/rancid-run.in')
-rw-r--r-- | bin/rancid-run.in | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bin/rancid-run.in b/bin/rancid-run.in index b09d8a0..02093bc 100644 --- a/bin/rancid-run.in +++ b/bin/rancid-run.in @@ -1,6 +1,6 @@ #! /bin/sh ## -## $Id: rancid-run.in,v 1.30 2004/03/12 23:17:28 heas Exp $ +## $Id: rancid-run.in,v 1.31 2004/12/24 00:55:26 tex Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -23,10 +23,9 @@ # @sysconfdir@/rancid.conf or those specified on the command-line. # +# Default ENVFILE, overrideable with -f flag. ENVFILE="@sysconfdir@/rancid.conf" -. $ENVFILE - TMPDIR=${TMPDIR:=/tmp}; export TMPDIR # control_rancid argv @@ -34,7 +33,7 @@ CR_ARGV=""; export CR_ARGV # print a usage message to stderr pr_usage() { - echo "usage: $0 [-r device_name] [-m mail rcpt] [group [group ...]]" >&2; + echo "usage: $0 [-f config_file] [-r device_name] [-m mail rcpt] [group [group ...]]" >&2; } # command-line options @@ -43,6 +42,16 @@ if [ $# -ge 1 ] ; then while [ 1 ] ; do case $1 in + -f) + shift + # next arg is the device name + ENVFILE="$1" + if [ -z $ENVFILE ]; then + pr_usage + exit 1 + fi + shift + ;; -r) shift # next arg is the device name @@ -74,6 +83,9 @@ if [ $# -ge 1 ] ; then done fi +. $ENVFILE + + if [ $# -ge 1 ] ; then LIST_OF_GROUPS="$*"; export LIST_OF_GROUPS elif [ "$LIST_OF_GROUPS" = "" ] ; then |