File: rc.p3scan

package info (click to toggle)
p3scan 2:2.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,568 kB
  • ctags: 2,371
  • sloc: ansic: 12,072; makefile: 253; sh: 234
file content (46 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# POP3 Virus Scanner startup script
#
# usage: p3scan { start | stop | restart | status }
#
# Jaime Nebrera - jnebrera@eneotecnologia.com
# Director de Organizacion - ENEO Tecnologia

case "$1" in
   start)
      # Start p3scan
      /usr/sbin/p3scan
      echo "P3Scan initiated"
      ;;
   stop)
      # Stop p3scan
      if [ -a /var/run/p3scan/p3scan.pid ]; then
         kill `cat /var/run/p3scan/p3scan.pid` &>/dev/null
         rm -f /var/run/p3scan/p3scan.pid
         echo "P3Scan terminated"
      else
         echo "Error: cannot find p3scan.pid"
         echo "Killing any p3scan daemon in the system ..."
         echo
         killall p3scan &>/dev/null
      fi
      ;;
   status)
      # P3Scan status
      if [ -a /var/run/p3scan/p3scan.pid ]; then
         PID=`cat /var/run/p3scan/p3scan.pid`
         echo "P3Scan OK, running: $PID"
      else
         echo "P3Scan is stopped"
      fi
      ;;
   restart)
      $0 stop
      $0 start
      ;;
   *)
      echo "Usage: p3scan { start | stop | restart | status }"
      exit 1
esac
exit 0