home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / de / comp / sources / os9 / 5 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  9.7 KB

  1. Xref: sparky de.comp.sources.os9:5 comp.os.os9:1547
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!sun-barr!news2me.EBay.Sun.COM!seven-up.East.Sun.COM!sungy!stasys!stasys!not-for-mail
  3. From: frank.kaefer@stasys.sta.sub.org (Frank Kaefer)
  4. Newsgroups: de.comp.sources.os9,comp.os.os9
  5. Subject: MNews Prerelease Part09/09
  6. Message-ID: <1hafdsINNptu@stasys.sta.sub.org>
  7. Date: 23 Dec 92 19:41:48 GMT
  8. Sender: news@stasys.sta.sub.org
  9. Followup-To: de.comp.sources.d
  10. Organization: Stasys News Server, Starnberg, Germany
  11. Lines: 387
  12. Approved: frank.kaefer@stasys.sta.sub.org (Frank Kaefer)
  13. NNTP-Posting-Host: stasys.sta.sub.org
  14.  
  15. Submitted-by: Ulrich Dessauer <ud@Nightmare.ddt.sub.org>
  16. Archive-name: mnews/part09
  17.  
  18. : ----- Cut here ----- Cut here ----- Cut here ----- Cut here -----
  19. : Use  sh filename  to extract shell archive
  20. : This shell archive contains following files:
  21. :     'SBATCH/sbatch.h                               820 bytes'
  22. :     'SH/check.sh                                  3841 bytes'
  23. :     'SH/install.sh                                2041 bytes'
  24. :     'SH/respool.sh                                 690 bytes'
  25. if test -f 'SBATCH/sbatch.h' ; then
  26.   echo 'File SBATCH/sbatch.h already exists, overwriting it'
  27.   del 'SBATCH/sbatch.h'
  28. fi
  29. echo Extracting \"'SBATCH/sbatch.h'\"
  30. sed "s/^X//" >'SBATCH/sbatch.h' <<'__END__OF__THIS__FILE__'
  31. X/*
  32. X * $Log:    sbatch.h_v $
  33. X * Revision 1.1  90/08/31  15:41:07  ud
  34. X * Initial revision
  35. X * 
  36. X */
  37. X# include    "news.h"
  38. X
  39. X# define    EXT_TAB        "Convtable"
  40. X
  41. X# define    BATCH_TMP    "tmp"
  42. X
  43. X# define    DEF_MAXSIZ    50000
  44. X# define    DEF_MAXARTSIZ    (-1)
  45. X
  46. X# define    DEF_BITSIZE    16
  47. X# define    DEF_GRADE    'T'
  48. X
  49. X# ifndef    EXTERN
  50. X# define    EXTERN        extern
  51. X# endif        EXTERN
  52. X
  53. XEXTERN int    error;
  54. X
  55. XEXTERN char    buffer[512];
  56. X
  57. XEXTERN char    *command;
  58. XEXTERN char    *transport;
  59. XEXTERN char    *encode;
  60. XEXTERN char    *compress;
  61. XEXTERN char    *freeze;
  62. XEXTERN char    *batchdir;
  63. XEXTERN char    *newsdir;
  64. XEXTERN char    *newslib;
  65. XEXTERN int    maxsiz;        /* maximum size of spoolfiles        */
  66. XEXTERN int    maxartsiz;    /* maximum size of one article        */
  67. XEXTERN int    bitsize;    /* # of bits for compress        */
  68. XEXTERN char    grade;        /* the grading, if supported        */
  69. XEXTERN int    convmode;    /* converting mode for news        */
  70. __END__OF__THIS__FILE__
  71. if test -f 'SH/check.sh' ; then
  72.   echo 'File SH/check.sh already exists, overwriting it'
  73.   del 'SH/check.sh'
  74. fi
  75. echo Extracting \"'SH/check.sh'\"
  76. sed "s/^X//" >'SH/check.sh' <<'__END__OF__THIS__FILE__'
  77. X:    'this shell script can be used to check your current news'
  78. X:    'installation, but be warned: it is sloowwwwwwww.....'
  79. X:    '$Id: check.sh_v 1.1 90/08/31 13:57:59 ud Exp $'
  80. X:    'Copyright (C) 1990 Ulrich Dessauer, Germering, Germany'
  81. X:
  82. X:    'Insert here your local configuration'
  83. X:
  84. XBATCHDIR=/h0/SPOOL/BATCH
  85. XNEWSDIR=/h0/SPOOL/NEWS
  86. XSPOOLDIR=/h0/SPOOL/RNEWS
  87. XNEWSLIB=/h0/USR/LIB/NEWS
  88. XHISTORY=${NEWSLIB}/HISTORY
  89. XNEWS=news
  90. X:
  91. X:    'Get GID.UID from password file'
  92. XOWNER=`grep ${NEWS}, /dd/SYS/password | gawk -F, '{ print  $3 }'`
  93. Xif [ X$OWNER = X ]
  94. Xthen
  95. X  OWNER=2.39
  96. Xfi
  97. Xecho 'Pass one, check existance of files.'
  98. Xfor file in $BATCHDIR $NEWSDIR $SPOOLDIR $NEWSLIB $HISTORY
  99. Xdo
  100. X  echo Check $file
  101. X  if test ! -d $file
  102. X  then
  103. X    echo -r $file 'is not available, Create it ? [y] '
  104. X    read ans
  105. X    case X$ans in
  106. X      X | X[Yy]*)
  107. X        makdir $file
  108. X        chown -u=$NEWS $file
  109. X    ;;
  110. X      X[Qq]*)
  111. X        echo 'Script aborted.'
  112. X    exit 1
  113. X    esac
  114. X  else
  115. X    own=`dir -ne $file | grep -v Bytecount | grep -ve=-------- | gawk '{ print $1 }'`
  116. X    if [ X$own != X$OWNER ]
  117. X    then
  118. X      echo -r 'Owner of' $file 'is not news, change it? [y] '
  119. X      read ans
  120. X      case X$ans in
  121. X    X | X[Yy]*)
  122. X          chown -u=$NEWS $file
  123. X          ;;
  124. X        X[Qq]*)
  125. X          echo 'Script aborted.'
  126. X      exit 1
  127. X      esac
  128. X    else
  129. X      echo 'Everything looks okay for' $file
  130. X    fi
  131. X  fi
  132. Xdone
  133. Xfor xfile in Active Distributions Sys send_uuname
  134. Xdo
  135. X  file=${NEWSLIB}/${xfile}
  136. X  echo Check $file
  137. X  if test ! -f $file
  138. X  then
  139. X    echo -r $file 'is not available, Create it ? [y] '
  140. X    read ans
  141. X    case X$ans in
  142. X      X | X[Yy]*)
  143. X        touch $file
  144. X        chown -u=$NEWS $file
  145. X        ;;
  146. X      X[Qq]*)
  147. X        echo 'Script aborted.'
  148. X        exit 1
  149. X    esac
  150. X  else
  151. X    own=`dir -e $file | grep -v Bytecount | grep -ve=-------- | gawk '{ print $1 }'`
  152. X    if [ X$own != X$OWNER ]
  153. X    then
  154. X      echo -r 'Owner of' $file 'is not news, change it? [y] '
  155. X      read ans
  156. X      case X$ans in
  157. X    X | X[Yy]*)
  158. X          chown -u=$NEWS $file
  159. X          ;;
  160. X        X[Qq]*)
  161. X          echo 'Script aborted.'
  162. X          exit 1
  163. X      esac
  164. X    else
  165. X      echo 'Everything looks okay for' $file
  166. X    fi
  167. X  fi
  168. Xdone
  169. Xecho 'Pass two, slightly syntax check of files in' $NEWSLIB
  170. Xcd $NEWSLIB
  171. Xecho 'Check Sys file'
  172. Xcnt=`wc -l Sys | gawk '{ print $1 }'`
  173. Xi=1
  174. Xwhile test $i -le $cnt
  175. Xdo
  176. X  sed -n ${i}p Sys | read line
  177. X  case X$line in
  178. X    X#*)
  179. X      echo 'Skip comment line'
  180. X      ;;
  181. X    *)
  182. X      count=`echo $line | gawk -F: '{ print NF }'`
  183. X      system=`echo $line | gawk -F: '{ print $1 }' | gawk -F/ '{ print $1 }'`
  184. X      case $count in
  185. X        3)
  186. X      echo $system 'will be spooled into' $SPOOLDIR
  187. X          ;;
  188. X        4)
  189. X      cmd=`echo $line | gawk -F: '{ print $4 }'`
  190. X      echo $system 'will use the command' $cmd
  191. X      ;;
  192. X        *)
  193. X      echo 'This line may contain some errors (has' $count 'entries)'
  194. X          echo $line
  195. X      ;;
  196. X      esac
  197. X      ;;
  198. X  esac
  199. X  i=`expr $i + 1`
  200. Xdone
  201. Xecho 'Check Active file'
  202. Xcnt=`wc -l Active | gawk '{ print $1 }'`
  203. Xi=1
  204. Xwhile test $i -le $cnt
  205. Xdo
  206. X  sed -n ${i}p Active | read line
  207. X  case X$line in
  208. X    X#*)
  209. X      echo 'Skip comment line'
  210. X      ;;
  211. X    *)
  212. X      count=`echo $line | gawk -F: '{ print NF }'`
  213. X      case $count in
  214. X        2)
  215. X      echo $line | gawk -F: '{ print $2 }' | read start end mod moderator
  216. X      status=OKAY
  217. X          if test $start -gt $end
  218. X      then
  219. X        echo 'Start (' $start ') is greater than end (' $end ') in line'
  220. X        echo $line
  221. X        status=ERR
  222. X      fi
  223. X      if [ X$mod = Xy ]
  224. X      then
  225. X        if [ X$moderator = X ]
  226. X        then
  227. X          echo 'No moderator in moderated group, you should add one; in line'
  228. X          echo $line
  229. X          status=ERR
  230. X        fi
  231. X      fi
  232. X      if [ $status = OKAY ]
  233. X      then
  234. X        echo $line 'looks okay'
  235. X      fi
  236. X          ;;
  237. X        *)
  238. X      echo 'This line may contain some errors (has' $count 'entries)'
  239. X          echo $line
  240. X      ;;
  241. X      esac
  242. X      ;;
  243. X  esac
  244. X  i=`expr $i + 1`
  245. Xdone
  246. X
  247. __END__OF__THIS__FILE__
  248. if test -f 'SH/install.sh' ; then
  249.   echo 'File SH/install.sh already exists, overwriting it'
  250.   del 'SH/install.sh'
  251. fi
  252. echo Extracting \"'SH/install.sh'\"
  253. sed "s/^X//" >'SH/install.sh' <<'__END__OF__THIS__FILE__'
  254. X:
  255. X:    '$Id: install.sh_v 1.1 90/11/03 02:18:17 ud Exp $'
  256. X:    'Copyright (C) 1989, 1990 by Ulrich Dessauer, Germering, Germany.'
  257. X:
  258. Xcd ..
  259. XBATCHDIR=`grep MNEWS_BATCHDIR config.h | gawk '{ print $4 }' | sed 's/"//g'`
  260. XNEWSDIR=`grep MNEWS_NEWSDIR config.h | gawk '{ print $4 }' | sed 's/"//g'`
  261. XSPOOLDIR=`grep MNEWS_RNEWS_SPOOLDIR config.h | gawk '{ print $4 }' | sed 's/"//g'`
  262. XNEWSLIB=`grep MNEWS_NEWSLIB config.h | gawk '{ print $4 }' | sed 's/"//g'`
  263. XHISTORY=${NEWSLIB}/HISTORY
  264. XOWNER=`grep news, /dd/SYS/password | gawk -F, '{ print  $3 }'`
  265. Xif [ X$OWNER = X ]
  266. Xthen
  267. X  OWNER=2.39
  268. Xfi
  269. Xstatus=OKAY
  270. Xif [ X$BATCHDIR = X ]
  271. Xthen
  272. X  echo 'Could not extract Batchdir properly'
  273. X  status=FAIL
  274. Xfi
  275. Xif [ X$NEWSDIR = X ]
  276. Xthen
  277. X  echo 'Could not extract Newsdir properly'
  278. X  status=FAIL
  279. Xfi
  280. Xif [ X$SPOOLDIR = X ]
  281. Xthen
  282. X  echo 'Could not extract Rnews-Spooldir properly'
  283. X  status=FAIL
  284. Xfi
  285. Xif [ X$NEWSLIB = X ]
  286. Xthen
  287. X  echo 'Could not extract Newslib properly'
  288. X  status=FAIL
  289. Xfi
  290. Xif [ ! X$status = XOKAY ]
  291. Xthen
  292. X  echo 'Abort due to intact config.h'
  293. X  exit 1
  294. Xfi
  295. Xecho -r 'Please type in the gid.uid of your News account [' $OWNER '] '
  296. Xread answer
  297. Xif [ X$answer = X ]
  298. Xthen
  299. X  owner=$OWNER
  300. Xelse
  301. X  owner=$answer
  302. Xfi
  303. Xfor dir in $BATCHDIR $NEWSDIR $SPOOLDIR $NEWSLIB $HISTORY
  304. Xdo
  305. X  if test ! -d $dir
  306. X  then
  307. X    echo -r 'Create missing directory' $dir '[y] ?'
  308. X    read answer
  309. X    if [ X$answer = X -o X$answer = Xy ]
  310. X    then
  311. X      makdir $dir
  312. X      chown $owner $dir
  313. X    fi
  314. X  else
  315. X    echo $dir 'exists.'
  316. X  fi
  317. Xdone
  318. X:
  319. X:    Install missing files, etc
  320. X:
  321. Xif test ! -d LIB
  322. Xthen
  323. X  echo 'No LIB directory in your distribution\?'
  324. X  exit 1
  325. Xfi
  326. Xcd LIB
  327. Xfor file in *
  328. Xdo
  329. X  destfile=${NEWSLIB}/$file
  330. X  if test ! -f $destfile
  331. X  then
  332. X    echo Copy $file to $destfile
  333. X    copy $file $destfile
  334. X    chown $owner $destfile
  335. X  fi
  336. Xdone
  337. Xactive=${NEWSLIB}/Active
  338. Xif test ! -f $active
  339. Xthen
  340. X  touch $active
  341. X  chown $owner $active
  342. Xfi
  343. Xfor entries in control junk local
  344. Xdo
  345. X  if [ ! X`bm -l $entries $active` = X$active ]
  346. X  then
  347. X    echo 'Create missing newsgroup' $entries
  348. X    inews -vac=newgroup:$entries </nil
  349. X  fi
  350. Xdone
  351. __END__OF__THIS__FILE__
  352. if test -f 'SH/respool.sh' ; then
  353.   echo 'File SH/respool.sh already exists, overwriting it'
  354.   del 'SH/respool.sh'
  355. fi
  356. echo Extracting \"'SH/respool.sh'\"
  357. sed "s/^X//" >'SH/respool.sh' <<'__END__OF__THIS__FILE__'
  358. X:    'This script can be used to feed articles stored in (typical)'
  359. X:    '/h0/SPOOL/RNEWS from a failed rnews operation'
  360. X:    '$Id$'
  361. X:    'Copyright (C) 1990 Ulrich Dessauer, Germering, Germany'
  362. X:
  363. X:    'Insert here your local configuration'
  364. X:
  365. XRNEWSDIR=/h0/SPOOL/RNEWS
  366. X:
  367. Xcd $RNEWSDIR
  368. Xif [ $? -ne 0 ]
  369. Xthen
  370. X  echo "Cannot chdir to $RNEWSDIR, aborted"
  371. X  exit 1
  372. Xfi
  373. Xfor i in *
  374. Xdo
  375. X  if [ "$i" = "*" ]
  376. X  then
  377. X    echo "No files in $RNEWSDIR"
  378. X    exit 0
  379. X  fi
  380. X  case X$i in
  381. X  [0-9]*)
  382. X    inews < $i
  383. X    if [ $? -eq 0 ]
  384. X    then
  385. X      del $i
  386. X    else
  387. X      echo "Article $i could not be fed successfully to inews"
  388. X    fi
  389. X    ;;
  390. X  *)
  391. X    echo "$i seems not to be a proper file to be feed to inews"
  392. X    ;;
  393. X  esac
  394. Xdone
  395. __END__OF__THIS__FILE__
  396. exit 0
  397. : end of shell archive
  398.  
  399. -- 
  400. Frank Kaefer # fkk@stasys.sta.sub.org # Starnberg, Germany
  401.