"Fossies" - the Fresh Open Source Software Archive

Member "freeha-1.0/service_scripts/cat.monitor" (23 Nov 2006, 874 Bytes) of package /linux/privat/old/freeha-1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 
    4 #-------------------------------------------------------------------------#
    5 #  Provided as a tool to be called from 'monitorhasrv'                    #
    6 #  This file acts as an example monitor script, for the dummy sample      #
    7 #  service, "cat /dev/zero"                                               #
    8 #  It could be replaced by "proc.monitor 'cat /dev/zero'", but that       #
    9 #  would not provide an example for a full three-fold service handler     #
   10 #                                                                         #
   11 #  Standard UNIX status: returns 0 on good, non-0 on bad.                 #
   12 #-------------------------------------------------------------------------#
   13 
   14 if [ -x /usr/ucb/ps ] ; then
   15     PROCLIST="/usr/ucb/ps aux"
   16 else
   17     PROCLIST="ps -ef"
   18 fi
   19 
   20 
   21 $PROCLIST | grep 'cat /d[e]v/zero' >/dev/null
   22 
   23 if [ $? -eq 0 ] ; then
   24     exit 0 
   25 fi
   26 
   27 exit 1
   28