Xref: utzoo news.software.b:5680 news.admin:10544 Path: utzoo!utstat!news-server.csri.toronto.edu!utgpu!attcan!lsuc!eci386!woods From: woods@eci386.uucp (Greg A. Woods) Newsgroups: news.software.b,news.admin Subject: Re: C news shell script questions Summary: how do I know you are running C News? Message-ID: <1990Sep6.175608.27743@eci386.uucp> Date: 6 Sep 90 17:56:08 GMT References: <1990Sep4.144525.7423@wrl.dec.com> <1990Sep4.165941.26080@zoo.toronto.edu> Reply-To: woods@eci386.UUCP (Greg A. Woods) Organization: Elegant Communications, Inc. Lines: 43 In article <1990Sep4.165941.26080@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: > In article <1990Sep4.144525.7423@wrl.dec.com> reid@wrl.dec.com (Brian Reid) writes: > >What code can I put in a shell script that will determine that a site is > >running C news? > > Hmm. Aside from the obvious question of knowing where the news directories > are, it should not be too hard. One reasonable approach would be to look > for /usr/lib/news/mailname, a file that is normally a required part of > C News (it's used to generate From: lines in inews) and doesn't exist in > B News that I know of. Personally I'd prefer it if the file used for such identification was either one used by both the C programmes and shell scripts, or else one common enough to be consistent on many sites. Paul Vixie's suggestion of explist would be bad for several sites I know of, where doexpire has been modified to use a succession of files in explist.d. I don't know how many people have changed inews enough to invalidate Henry's choice of mailname, but even if the number is zero, my reasoning should still hold. How about "/usr/lib/news"/bin/config? Or maybe "/usr/lib"/newsbin? I would say the biggest problem will be finding the news directories. The only way we've done that is by looking in several obvious places, with a preferred order. That still won't work for sites that have so little imagination that they mount partitions on places like "/usr2/lib/news". You can probably try these in the given order: /usr/lib/news (the de-facto standard way) /usr/local/lib/news (my preference) /usr/local/news (quite common in my experience) /local/lib/news (quite common too, and my second choice) /local/news /var/lib/news (though these are usually just symlinks) /var/news though I'm sure there are many more possibilites than one can list. -- Greg A. Woods woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP +1-416-443-1734 [h] +1-416-595-5425 [w] VE3-TCP Toronto, Ontario CANADA