Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Unnamed
Sunday, December 2nd, 2007 at 7:19:51pm UTC 

  1. #!/bin/sh
  2.  
  3. # Crontab script for Anope
  4.  
  5. # Anope binary directory
  6. ANOPATH=/home/ircd/services/daemon/
  7.  
  8. # Name of the pid file
  9. ANOPIDF=services.pid
  10.  
  11. # Name of the executable
  12. ANOPROG=services
  13.  
  14. PATH=/bin:/usr/bin:/usr/local/bin
  15.  
  16. ANOPID=
  17.  
  18. cd $ANOPATH
  19. if [ -f $ANOPIDF ]
  20. then
  21. # If pid file is found
  22.         ANOPID=`cat $ANOPIDF`
  23.         if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
  24.         then
  25.                 # services.pid is found and is running...
  26.                 # exit silently ;-)
  27.                 exit
  28.         fi
  29.         # If pid exists, but isn't found running...
  30.         echo "Anope Crontab notice:"
  31.         echo ""
  32.         echo "Stale $ANOPIDF file (erasing it)."
  33.         echo ""
  34.         # remove it
  35.         rm -f $ANOPIDF
  36. fi
  37. # If the pid file isn't found...start anope...
  38. echo "Anope Crontab notice:"
  39. echo ""
  40. echo "Couldn't find the services running. Reloading it..."
  41. echo ""
  42. ./$ANOPROG

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right worth-right