summaryrefslogtreecommitdiffstats
path: root/source/n/dovecot/rc.dovecot
blob: c79b96e779bf8f999cc75203f66560250f8916ea (about) (plain) (blame)
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/sh

dovecot_start()
{
  echo "Starting dovecot:  /usr/sbin/dovecot"
  /usr/sbin/dovecot
}

dovecot_stop()
{
  echo "Stopping dovecot..."
  /usr/bin/doveadm stop
}

dovecot_status()
{
  /usr/bin/doveadm service status
}

dovecot_reload()
{
  echo "Reloading dovecot..."
  /usr/bin/doveadm reload
}

case $1 in
'start')
  dovecot_start
  ;;
'stop')
  dovecot_stop
  ;;
'status')
  dovecot_status
  ;;
'restart')
  dovecot_stop
  sleep 3
  dovecot_start
  ;;
'reload')
  dovecot_reload
  ;;
*)
  echo "usage $0 start|stop|restart|reload|status"
esac