All pastes #627357 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-20 08:32 UTC
rendered paste body
bk@mail4:~$ cat /etc/init.d/dovecot 
#!/bin/sh

DAEMON=/usr/local/sbin/dovecot

test -x $DAEMON || exit 0
set -e

base_dir=`$DAEMON -a|grep '^base_dir: '|sed 's/^base_dir: //'`
pidfile=$base_dir/master.pid

if test -f $pidfile; then
  running=yes
  else
 running=no
 fi

 case "$1" in
  start)
 echo -n "Starting Dovecot"
   $DAEMON
    echo "."
     ;;
  stop)
    if test $running = yes; then
         echo "Stopping Dovecot"
        kill `cat $pidfile`
      echo "."
   else
   echo "Dovecot is already stopped."
   fi
   ;;
  reload)
  if test $running = yes; then
  echo -n "Reloading Dovecot configuration"
  kill -HUP `cat $base_dir/master.pid`
  echo "."
   else
  echo "Dovecot isn't running."
  fi
  ;;
    restart|force-reload)
    echo -n "Restarting Dovecot"
   if test $running = yes; then
   kill `cat $base_dir/master.pid`
   sleep 1
    fi
    $DAEMON
    echo "."
    ;;
  *)
  echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
      exit 1
      ;;
      esac
exit 0