-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathsphinx_rotate.sh
More file actions
executable file
·34 lines (29 loc) · 1.01 KB
/
sphinx_rotate.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# CATS Sphinx Full Index Updater
#
# $Id: sphinx_rotate.sh 2987 2007-08-31 20:42:15Z will $
if [ -f ~/ENVIRONMENT.conf ];
then
CATS_PATH=`cat ~/ENVIRONMENT.conf | grep "CATS_PATH=\"" | sed -e "s/CATS_PATH=\"//" | sed -e "s/\"//"`
PHP_PATH=`cat ~/ENVIRONMENT.conf | grep "PHP_PATH=\"" | sed -e "s/PHP_PATH=\"//" | sed -e "s/\"//"`
SPHINX_BIN=`cat ~/ENVIRONMENT.conf | grep "SPHINX_BIN=\"" | sed -e "s/SPHINX_BIN=\"//" | sed -e "s/\"//"`
SPHINX_CONFIG=`cat ~/ENVIRONMENT.conf | grep "SPHINX_CONFIG=\"" | sed -e "s/SPHINX_CONFIG=\"//" | sed -e "s/\"//"`
else
CATS_PATH="/usr/local/www/catsone.com/data"
PHP_PATH="/usr/local/bin/php"
SPHINX_BIN="/usr/local/bin"
SPHINX_CONFIG="${CATS_PATH}/config/sphinx/sphinx.conf"
fi
if [ ! -f "${SPHINX_BIN}/indexer" ];
then
echo "${SPHINX_BIN}/indexer does not exist."
exit 1
fi
if [ ! -f "${SPHINX_CONFIG}" ];
then
echo "${SPHINX_CONFIG} does not exist."
exit 1
fi
${SPHINX_BIN}/indexer --all --rotate --config "${SPHINX_CONFIG}"
exit 0