Another question!!!
I´m doing s squid check procees script.... Works very well but in some cases fail.... because i check if the squid.pid file still exist in /var/run...
Yesterday squid procees died but squid.pid continued in /var/run... for these reason my script can´t detect that squid was die...
here is my actual script:
- Código: Selecionar todos
#!/bin/sh
#
DEBUG=0
# argentobr variables
. /argentobr/variables.conf
. /argentobr/mailsend.conf
if [ -n "`ls /var/run/squid.pid`" ] ; then
echo "squid esta funcionando"
else
echo "squid no esta funcionando"
/argentobr/squidstart
/argentobr/mailsend -d $host -smtp $smtp -t $para -f $de -sub "$asunto" < $mensaje
fi
echo ""
I know if i use squid -k check command it will return to me a message... How can i do a script that returns to me a variable with 0 or 1.... 0 for squid is running... 1 for squid stop...
Regards...