Blame SOURCES/cyr_systemd_helper

62c494
#!/bin/sh
62c494
# get_config [config default]
62c494
# extracts config option from config file
62c494
get_config() {
62c494
  if conf=$(grep "^$1" /etc/imapd.conf); then
62c494
    echo $conf | cut -d: -f2
62c494
  else
62c494
    echo $2
62c494
  fi
62c494
}
62c494
62c494
CONFIGDIRECTORY=$(get_config configdirectory /var/lib/imap)
62c494
RETVAL=0
62c494
62c494
start() {
62c494
      cd $CONFIGDIRECTORY
62c494
      runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null
62c494
      RETVAL=$?
62c494
}
62c494
62c494
stop() {
62c494
      cd $CONFIGDIRECTORY
62c494
      runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null
62c494
      RETVAL=$?
62c494
}
62c494
62c494
case "$1" in
62c494
  start)
62c494
    start
62c494
    ;;
62c494
  stop)
62c494
    stop
62c494
    ;;
62c494
  *)
62c494
    ;;
62c494
esac
62c494
62c494
exit $RETVAL