On Tue, Sep 11, 2012 at 02:17:43PM -0500, Steve Linabery wrote: > Added command line options -y|--assumeyes to force operation. > If not provided, prompt user for confirmation to proceed. > --- > bin/aeolus-cleanup | 16 +++++++++++++--- > 1 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup > index eadc2ed..546d828 100755 > --- a/bin/aeolus-cleanup > +++ b/bin/aeolus-cleanup > @@ -19,18 +19,19 @@ usage() > cat << EOF > > USAGE: > -aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] > [-p|--profile] > +aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] > [-y|--assumeyes] [-p|--profile] > > OPTIONS: > -h | --help Show this message. > -d | --debug Debug logging mode. > -v | --verbose Verbose logging mode. > -s | --savedata Do not delete existing data. > + -y | --assumeyes Assume yes; assume that the answer to any question > which would be asked is yes. > -p | --profile Name of profile to use. A comma separated list can be > used to specify multiple profiles. > EOF > } > > -args=`getopt -o :hdvsp: --long help,debug,verbose,savedata,profile -- "$@"` > +args=`getopt -o :hdvsyp: --long > help,debug,verbose,savedata,assumeyes,profile -- "$@"` > if test $? != 0 > then > usage > @@ -39,6 +40,7 @@ fi > > SAVE_DATA=false > PUPPET_NODE='default' > +ASSUME_YES=false > > eval set -- $args > while true ; do > @@ -46,13 +48,21 @@ while true ; do > -h|--help) usage ; exit 1 ; shift ;; > -d|--debug) LOGLEVEL="--debug" ; shift ;; > -v|--verbose) LOGLEVEL="--verbose" ; shift ;; > - -s|--savedata) SAVE_DATA=true ; shift ;; > + -s|--savedata) SAVE_DATA=true ; shift ;; > + -y|--assumeyes) ASSUME_YES=true ; shift ;; > -p|--profile) PUPPET_NODE=$2 ; shift ; shift ;; > --) shift ; break ;; > *) usage ; exit 1 ;; > esac > done > > +if [ $ASSUME_YES != true ]; then > + read -p "aeolus-cleanup will delete local aeolus installations. Are you > sure you wish to proceed? [y/N]" > + if [[ $REPLY != "y" && $REPLY != "Y" ]]; then > + exit > + fi > +fi > + > export FACTER_AEOLUS_ENABLE_HTTPS=true > export FACTER_AEOLUS_ENABLE_SECURITY=false > export FACTER_AEOLUS_SAVE_DATA=$SAVE_DATA > -- > 1.7.7.6 >
Just realized this will require an edit to the manpage for aeolus-cleanup. Will resend patch with those edits. s|e
