"Fossies" - the Fresh Open Source Software Archive

Member "hermes-1.9/dists/fc_init" (29 Jun 2014, 829 Bytes) of package /linux/privat/hermes-1.9.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. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # Startup script for hermes
    3 #
    4 # chkconfig: 3 95 05
    5 # description: hermes
    6 
    7 # Source function library.
    8 . /etc/rc.d/init.d/functions
    9 
   10 prog=hermes
   11 configfile=/etc/hermes/hermesrc
   12 
   13 start() {
   14   echo -n $"Starting $prog: "
   15   daemon --check=$prog /usr/bin/hermes $configfile
   16   RETVAL=$?
   17   echo
   18 }
   19 
   20 stop() {
   21   echo -n $"Stopping $prog: "
   22   killproc $prog
   23   RETVAL=$?
   24   echo
   25 }
   26 
   27 safestop() {
   28   echo -n $"Stopping $prog(will process pending connections):"
   29   killproc $prog -INT
   30   rm /var/run/$prog.pid
   31   RETVAL=$?
   32   echo
   33 }
   34 
   35 case "$1" in
   36   start)
   37     start
   38     ;;
   39 
   40   stop)
   41     stop
   42     ;;
   43 
   44   restart)
   45     safestop
   46     sleep 2
   47     start
   48     ;;
   49   condrestart)
   50     if test "x`pidfileofproc $prog`" != x; then
   51     stop
   52     start
   53     fi
   54     ;;
   55 
   56   *)
   57     echo $"Usage: $0 {start|stop|restart|condrestart}"
   58     exit 1
   59 
   60 esac
   61 
   62 exit $RETVAL