Communauté Eggdrop
Check de lycanobot - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Un peu plus loin (https://forum.eggdrop.fr/forumdisplay.php?fid=16)
+--- Sujet : Check de lycanobot (/showthread.php?tid=1230)



Check de lycanobot - CrazyCat - 02/09/2012

Pour ceux qui utilisent lycanobot (la version originale en perl), voici un petit script bash à utiliser avec un crontab pour vérifier que le robot est bien lancé, et le relancer le cas échéant:
Code :
#!/bin/sh

###############################################################
# CONFIGURATION
###############################################################

# Path of the bot
LYCAPATH=/home/lycanobot/
# Name of the executable
LYCAPROG=lycanobot.pl

###############################################################
#                 DON'T EDIT ANYTHING BELOW                   #
###############################################################
PATH=/bin:/usr/bin:/usr/local/bin
cd $LYCAPATH
if [ `ps auwx | grep $LYCAPROG | grep -v -c grep` = 1 ]
   then
      exit    
fi
./$LYCAPROG