"Fossies" - the Fresh Open Source Software Archive

Member "sshdfilter-1.5.7/etc/init.d/sshdfilter" (14 Jan 2007, 1086 Bytes) of package /linux/privat/old/sshdfilter-1.5.7.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/bash
    2 #
    3 # Startup file for sshdfilter in standalone mode
    4 #
    5 # chkconfig: 2345 57 22
    6 # description: sshdfilter standalone daemon
    7 #
    8 # processname: sshdfilter
    9 # pidfile: /var/run/sshdfilter.pid.<chain>
   10 
   11 RETVAL=0
   12 
   13 umask 077
   14 
   15 start() {
   16     echo -n $"Starting sshdfilter: "
   17     export PATH=$PATH:/usr/local/sbin
   18     sshdfilter
   19     RETVAL=$?
   20     return $RETVAL
   21 }   
   22 stop() {
   23     echo -n $"Shutting down sshdfilter: "
   24         if [ -z "`echo /var/run/sshdfilter* | grep \*`" ]; then
   25            for i in /var/run/sshdfilter* ; do
   26               P=`cat $i`
   27               echo "Killing pid $i, $P"
   28               kill $P
   29            done
   30            sleep 1
   31         fi
   32     RETVAL=$?
   33     return $RETVAL
   34 }
   35 status() {
   36     echo "Process table:"
   37         ps -ef | grep sshdfilter | grep -v grep
   38         echo "Recorded pids:"
   39         for i in /var/run/sshdfilter* ; do
   40            echo "$i = `cat $i`"
   41         done
   42 }
   43 restart() {
   44     stop
   45     start
   46 }   
   47 
   48 case "$1" in
   49   start)
   50     start
   51     ;;
   52   stop)
   53     stop
   54     ;;
   55   status)
   56     status
   57     ;;
   58   restart|reload)
   59     restart
   60     ;;
   61   *)
   62     echo $"Usage: $0 {start|stop|status|restart}"
   63     exit 1
   64 esac
   65 
   66 exit $?
   67