This commit is contained in:
parent
a2c5eca093
commit
3aaac41498
40
Sphinx.sh
40
Sphinx.sh
@ -72,16 +72,16 @@ then
|
|||||||
echo -e "2. Past version : 0.9.9\n"
|
echo -e "2. Past version : 0.9.9\n"
|
||||||
;;
|
;;
|
||||||
'--install')
|
'--install')
|
||||||
#Environement for installation
|
|
||||||
if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi
|
if [ ! -e /dbs ];then `mkdir /dbs`; dbs="Success"; fi
|
||||||
#repertoire temporaire.
|
|
||||||
if [ ! -e tmp ];then `mkdir tmp`; fi
|
if [ ! -e tmp ];then `mkdir tmp`; fi
|
||||||
if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi
|
if [ ! -e /dbs/sphinx ];then echo -e "/dbs/sphinx Doesn't exist !"; exit; fi
|
||||||
if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi
|
if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; exit; fi
|
||||||
if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi
|
if [ ! -e /usr/local/sphinx ];then `mkdir /dbs/sphinx`; exit; fi
|
||||||
if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/; chmod +x /etc/init.d/sphinxsearch ;update-rc.d sphinxsearch defaults`; fi
|
if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi
|
||||||
if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi
|
if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi
|
||||||
#Check if package in directory, if you want to download manually the package
|
|
||||||
if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ]
|
if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ]
|
||||||
then
|
then
|
||||||
if [ ! -z $2 ]; then
|
if [ ! -z $2 ]; then
|
||||||
@ -167,6 +167,38 @@ then
|
|||||||
echo -e $VERT"The refresh as been finish ! great ! thank's damien :)"$NORMAL
|
echo -e $VERT"The refresh as been finish ! great ! thank's damien :)"$NORMAL
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
'--add')
|
||||||
|
`mkdir config/${HOSTANME}`
|
||||||
|
echo -n "Machine MASTER ? (y/n) : "; read response
|
||||||
|
`touch /usr/local/sphinx/etc/sphinx.conf`;
|
||||||
|
echo -e $ROUGE"Mode MASTER activated"$NORMAL
|
||||||
|
echo -e "Tapez 'stop' pour quiter l'invite de création des indexes"
|
||||||
|
while [ indexe != "stop\n" ]; do
|
||||||
|
echo -e " Entrez indexe : "; read indexe
|
||||||
|
if [ $response = 'y' ];then
|
||||||
|
if [ -e config/base/Master/$indexe.conf-MysqlServer ]
|
||||||
|
then
|
||||||
|
`cp config/base/Master/$indexe.conf-MysqlServer config/${HOSTNAME}/`
|
||||||
|
echo -e "Indexe $indexes as been create !";
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -e config/base/Slave/$indexe.conf-MysqlServer ]
|
||||||
|
then
|
||||||
|
`cp config/base/Slave/$indexe.conf-MysqlServer config/${HOSTNAME}/`
|
||||||
|
echo -e "Indexe ''$indexes'' as been create !";
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done;
|
||||||
|
`cat config/base/sphinx.conf > /usr/local/sphinx/etc/sphinx.conf `;
|
||||||
|
`cat config/${HOSTNAME}/*.conf-MysqlServer >> /usr/local/sphinx/etc/sphinx.conf`;
|
||||||
|
`./Sphinx --refresh`
|
||||||
|
echo -e $VERT"The installation as been finish ! great ! thank's damien :)"$NORMAL
|
||||||
|
exit
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
#Default
|
#Default
|
||||||
echo -e $ROUGE"[Erreur]" ${ERREURS["CMD"]} $NORMAL
|
echo -e $ROUGE"[Erreur]" ${ERREURS["CMD"]} $NORMAL
|
||||||
|
Loading…
Reference in New Issue
Block a user