#!/bin/sh

# Try to use cnews or inn automatically by checking the copyright files.
# Don't check newsfeeds in case they are from a deinstalled package.
# We used to call news.real if we were passed any paramters,
# but this is probably a bad idea, so those lines are commented out.

NEWSX=/usr/lib/news/bin/newsx.real

#if [ $# ]; then  
#  $NEWSX $*
#else
  if [ -e /usr/doc/inn/copyright ] ; then
    if [ -e /usr/doc/cnews/copyright ] ; then
      echo "Both cnews and inn found. Either fix this or call $NEWSX directly" >&2
      exit 2
    else
      $NEWSX --inn $*
    fi
  elif [ -e /usr/doc/cnews/copyright ] ; then
    $NEWSX --cnews --newsfeeds /etc/news/sys $*
  else
    echo "Neither cnews or inn was found. Either fix this or call $NEWSX directly" >&2
    exit 3
  fi
#fi
