2006-01-26 00:37:29 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2006-03-21 15:25:41 -05:00
|
|
|
# Copyright 2006 The Apache Software Foundation
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2006-01-26 00:37:29 -05:00
|
|
|
#
|
|
|
|
# Shell script to disable snappuller
|
|
|
|
|
2006-03-21 15:25:41 -05:00
|
|
|
orig_dir=$(pwd)
|
|
|
|
cd ${0%/*}/..
|
|
|
|
solr_root=$(pwd)
|
|
|
|
cd ${orig_dir}
|
2006-01-26 00:37:29 -05:00
|
|
|
|
2006-03-21 15:25:41 -05:00
|
|
|
unset user verbose
|
|
|
|
. ${solr_root}/bin/scripts-util
|
2006-01-26 00:37:29 -05:00
|
|
|
|
|
|
|
# set up variables
|
|
|
|
prog=${0##*/}
|
2006-03-21 15:25:41 -05:00
|
|
|
log=${solr_root}/logs/snappuller.log
|
2006-01-26 00:37:29 -05:00
|
|
|
|
|
|
|
# define usage string
|
|
|
|
USAGE="\
|
2006-03-21 15:25:41 -05:00
|
|
|
usage: $prog [-u username] [-v]
|
|
|
|
-u specify user to sudo to before running script
|
2006-01-26 00:37:29 -05:00
|
|
|
-v increase verbosity
|
|
|
|
"
|
|
|
|
|
|
|
|
# parse args
|
2006-03-21 15:25:41 -05:00
|
|
|
while getopts u:v OPTION
|
2006-01-26 00:37:29 -05:00
|
|
|
do
|
|
|
|
case $OPTION in
|
2006-03-21 15:25:41 -05:00
|
|
|
u)
|
|
|
|
user="$OPTARG"
|
|
|
|
;;
|
2006-01-26 00:37:29 -05:00
|
|
|
v)
|
|
|
|
verbose="v"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "$USAGE"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2006-03-21 15:25:41 -05:00
|
|
|
fixUser "$@"
|
2006-01-26 00:37:29 -05:00
|
|
|
|
2006-03-21 15:25:41 -05:00
|
|
|
start=`date +"%s"`
|
2006-01-26 00:37:29 -05:00
|
|
|
|
|
|
|
logMessage disabled by $oldwhoami
|
2006-03-21 15:25:41 -05:00
|
|
|
logMessage command: $0 $@
|
|
|
|
name=${solr_root}/logs/snappuller-enabled
|
2006-01-26 00:37:29 -05:00
|
|
|
|
|
|
|
if [[ -f ${name} ]]
|
|
|
|
then
|
|
|
|
rm -f ${name}
|
|
|
|
else
|
|
|
|
logMessage snappuller not currently enabled
|
|
|
|
logExit exited 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
logExit ended 0
|