home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.16 / etc / mail / sendmailrc / sendmailrc~
Text File  |  1998-08-19  |  1KB  |  69 lines

  1. :
  2. # The following was generated from 
  3. # NLS/en/sendmailrc.gen
  4. #
  5. MF_SENDMAILRC=sendmailrc.cat@mail
  6. #
  7. MS_SENDMAILRC=1
  8. USAGE=1
  9. # Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  10. #                                                                         
  11. #        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  12. #                   SANTA CRUZ OPERATION INC.                             
  13. #                                                                         
  14. #   The copyright notice above does not evidence any actual or intended   
  15. #   publication of such source code.                                      
  16.  
  17. #ident "@(#)sendmailrc.sh    11.5"
  18.  
  19. # our start/stop sendmail script
  20.  
  21. cleanup() {
  22.     rm -f /tmp/pid$$
  23.     exit $1
  24. }
  25.  
  26. umask 022
  27.  
  28. FILE=/etc/sendmail.pid
  29.  
  30. cd /etc/mail
  31.  
  32. ps -aef > /tmp/pid$$
  33.  
  34. case "$1" in
  35. start)
  36.     if grep "/usr/lib/sendmail -q" /tmp/pid$$ > /dev/null
  37.     then
  38.         cleanup 0
  39.     fi
  40.     rm -f $FILE ; touch $FILE
  41.     # Check if network is there
  42.     check=`netcfg -s | grep tcp`
  43.     if [ "$check" = "" ]
  44.     then
  45.         echo "hosts files" > /etc/service.switch
  46.     else
  47.         rm -f /etc/service.switch
  48.     fi
  49.     # rebuild aliases file if needed
  50.     /etc/mail/newaliases > /dev/null
  51.     /usr/lib/sendmail -q1m -bd
  52.     cleanup 0
  53.     ;;
  54. stop)
  55.     if [ -s /etc/sendmail.pid ]
  56.     then
  57.         read pid < $FILE
  58.         kill $pid
  59.         rm -f $FILE; touch $FILE
  60.         sleep 2
  61.     fi
  62.     cleanup 0
  63.     ;;
  64. *)
  65.     dspmsg $MF_SENDMAILRC -s $MS_SENDMAILRC $USAGE "Usage: $0 start|stop\n" $0
  66.     cleanup 0
  67.     ;;
  68. esac
  69.