#! /bin/sh
# newshostname - print the hostname known to the news system
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/public/lib/news/bin/config}
# export NEWSCTL NEWSBIN NEWSARTS

PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

# "test -r && cat" is used here instead of just "cat" because pre-v8
# cat's are broken and return good status when they can't read their files.
( (test -r $NEWSCTL/whoami && cat $NEWSCTL/whoami) || hostname ||
	(test -r /etc/whoami && cat /etc/whoami) ||
	uuname -l || uname -n || echo the_unknown_host) 2>/dev/null
