Don't like ads? PRO users don't see any ads ;-)
Guest

/etc/rc.d/clamfs

By: a guest on Apr 15th, 2010  |  syntax: Bash  |  size: 0.86 KB  |  hits: 389  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5.  
  6. # source application-specific settings
  7.  
  8. PID=`pidof -o %PPID /usr/bin/clamfs`
  9.  
  10. case "$1" in
  11.   start)
  12.     # if clamd isn't started first, notifyclamd fails at times
  13.        stat_busy "Starting ClamFS"
  14.        [ -z "$PID" ] && /usr/bin/clamfs /etc/clamav/clamfs.xml > /dev/null
  15.        if [ $? -gt 0 ]; then
  16.           stat_fail
  17.        else
  18.           add_daemon clamfs
  19.           stat_done
  20.        fi
  21.  
  22.     ;;
  23.   stop)
  24.        stat_busy "Stopping ClamFS"
  25.         [ -n "$PID" ] && kill $PID &> /dev/null
  26.         if [ $? -gt 0 ]; then
  27.            stat_fail
  28.         else
  29.            rm_daemon clamfs
  30.            stat_done
  31.         fi
  32.  
  33.     ;;
  34.   restart)
  35.     $0 stop
  36.     # will not start if not fully stopped, so sleep
  37.     sleep 2
  38.     $0 start
  39.     ;;
  40.   *)
  41.     echo "usage: $0 {start|stop|restart}"  
  42. esac
  43. exit 0