home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / CNEWS / _CNEWS.TAR / usr / lib / newsbin / newshostname next >
Encoding:
Text File  |  1994-09-02  |  482 b   |  19 lines

  1. #! /bin/sh
  2. # newshostname - print the hostname known to the news system
  3. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  4. . ${NEWSCONFIG-/var/lib/news/bin/config}
  5. # export NEWSCTL NEWSBIN NEWSARTS
  6.  
  7. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  8. umask $NEWSUMASK
  9.  
  10. # dd returns correct exit status, unlike cat, so we use it, despite its
  11. # baroque command syntax
  12. exec 2>/dev/null
  13. dd if=$NEWSCTL/whoami ||
  14.     hostname ||
  15.     dd if=/etc/whoami ||
  16.     uuname -l ||
  17.     uname -n ||
  18.     echo the_unknown_host
  19.