File: init

package info (click to toggle)
solid-pop3d 0.15-14
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 868 kB
  • ctags: 443
  • sloc: ansic: 6,085; sh: 4,268; makefile: 519
file content (50 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download
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
47
48
49
50
#!/bin/sh
# /etc/init.d/solid-pop3
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for exim by Tim Cutts <timc@chiark.greenend.org.uk>
# Modified for solid-pop3 by Adam D. Barratt <adam-debian@adam-barratt.org.uk>.

set -e

OPTS=""
DAEMON=/usr/sbin/solid-pop3d
NAME=solid-pop3d
CONFIGFILE=/etc/default/solid-pop3d
[ -x "$DAEMON" ] || exit 0

RUN_MODE="inetd"
[ -r "$CONFIGFILE" ] && . "$CONFIGFILE"
[ "$RUN_MODE" = "daemon" ] || exit 0


case "$1" in
  start)
    echo -n "Starting virtual pop daemon: "
    start-stop-daemon --start --quiet --exec $DAEMON -- $OPTS
    echo "$NAME."
    ;;

  stop)
    echo -n "Stopping virtual pop daemon: "
    start-stop-daemon --stop --quiet --oknodo --retry 30 \
      --exec $DAEMON
    echo "$NAME."
    ;;

  restart|reload|force-reload)
    echo -n "Restarting virtual pop daemon: "
    start-stop-daemon --stop  --quiet --oknodo --retry 30 \
      --exec $DAEMON
    start-stop-daemon --start --quiet --exec $DAEMON -- $OPTS
    echo "$NAME."
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0