#!/bin/sh
#
# $NetBSD: innd.sh,v 1.7 1999/07/29 21:15:46 tron Exp $
#
if [ -x /usr/pkg/inn/bin/rc.news -a -s /var/news/db/active ];
then
 su news -c /usr/pkg/inn/bin/rc.news >/dev/null

 if [ ! -f /usr/pkg/etc/nntp/server ]
 then
  hostname >/usr/pkg/etc/nntp/server
 fi

 if [ ! -f /usr/pkg/etc/nntp/domainname ]
 then
  set - X `grep -w ^fromhost: /var/news/etc/inn.conf | head -1`
  if [ $# -eq 3 ]
  then
   echo $3 >/usr/pkg/etc/nntp/domainname
  fi
 fi

 echo -n ' innd'
fi
exit 0
