?? suck_040225.shar
字號:
#!/bin/sh# This is a shell archive (produced by GNU sharutils 4.2.1).# To extract the files from this archive, save it to some FILE, remove# everything before the `!/bin/sh' line above, then type `sh FILE'.## Made on 2004-02-25 15:33 NZDT by <news@squay>.# Source directory was `/news/spool/src'.## Existing files will *not* be overwritten unless `-c' is specified.## This shar contains:# length mode name# ------ ---------- ------------------------------------------# 16623 -r--r--r-- suck/README2# 11124 -r-xr-xr-- suck/setup_inn.sh# 20890 -r-xr-xr-- suck/setup_suck.sh# 8595 -r-xr-xr-- suck/get.news.inn# 1420 -r--r--r-- suck/suck.conf# 4626 -r-xr-xr-- suck/put.news.sm# 1938 -r--r--r-- suck/rpost.sm.conf# 983 -r--r--r-- suck/put.news.head.conf# 1395 -r--r--r-- suck/put.news.body.conf# 6139 -r--r--r-- suck/README# 3867 -r--r--r-- suck/README3# 1488 -r-xr-xr-x suck/make_shar.sh#save_IFS="${IFS}"IFS="${IFS}:"gettext_dir=FAILEDlocale_dir=FAILEDfirst_param="$1"for dir in $PATHdo if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then set `$dir/gettext --version 2>&1` if test "$3" = GNU then gettext_dir=$dir fi fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fidoneIFS="$save_IFS"if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILEDthen echo=echoelse TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s"fiif touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$2 "$8"'else shar_touch=: echo $echo 'WARNING: not restoring timestamps. Consider getting and' $echo "installing GNU \`touch', distributed in GNU File Utilities..." echofirm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch#if mkdir _sh04985; then $echo 'x -' 'creating lock directory'else $echo 'failed to create lock directory' exit 1fi# ============= suck/README2 ==============if test ! -d 'suck'; then $echo 'x -' 'creating directory' 'suck' mkdir 'suck'fiif test -f 'suck/README2' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'suck/README2' '(file already exists)'else $echo 'x -' extracting 'suck/README2' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'suck/README2' &&@(#)README2 Version: 1.1 Date: 04/02/09 13:04:13 Author: PBSTo contact the Author: lmrlnATbigfoot.com replace AT with @Copyright (C) 2003 Philip Baird ShearerXThis text is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version.XThis text is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.http://www.gnu.org/copyleft/gpl.html#SEC3########################################################################XXHow to set up suck using setup_suck.sh########################################################################CONTENTSIN A HURRY?NOW FOR A LONGER EXPLANATIONX NTRODUCTIONX SUCKX CUSTOMISATIONX SETUPAppendix 1 -- Text of "setup_suck.sh" -Help Appendix 2 -- Adding or deleting news groups to the active fileX How to down load a list of active news groups from your ISP:X How to update the active file########################################################################IN A HURRY?Xthen run the following commands:X su - X su - newsX suck_yymmdd.shar # where yymmdd is the version of the shar fileX cd suckX setup_inn.shX exitX /etc/init.d/innd restartX su - newsX setup_suck.shX cd $HOMEX suck/get.news.innXYou may wish to add a line to the news crontab with the command:contab -eXX 21 2,6,18 * * * /sbin/chkconfig innd && suck/get.news.innXSee man crontab(5) for an explanation of the format. This settingdownloads at 21 minutes past the hour 3 times a day at 2am,6am,and 6pmX########################################################################NOW FOR A LONGER EXPLANATIONXINTRODUCTIONXThis shar ball contains scripts to install a set of wrapper scriptsfor suck. They are closely based on the suck distribution sample files.Two setup scripts are included in the ball which attempt to set up INNand "suck" to work together to allow "copying news from an NNTP server toyour local machine, and copying replies back up to an NNTP server."X* You must have a version of inn on your system owned by the news userX who is usually "news". It needs to have been installed correctly butX it does not have to be working. The script setup_inn.sh will try toX do that.X* You must have a working binary of suck installed on your machine andX in the path of the news owner. if you do not then go the suck webX site and pick up a copy from http://www.sucknews.org. The README fileX included with this version of theXXSee SETUP (below) for how to setup a working suck wrapper environment.Xget.news.inn -- main wrapper for "suck" and "rpost"X .suckenvrc -- environment variables, linked toX ~news/.suckenvrc (generated by setup_suck.sh)X suck.conf -- parameters passed to the program suckXput.news.sm -- called by get.news.inn wrapper for "rpost"X put.news.body.conf -- "sed -f script-file" stops put.news.smX from altering the body of a news message.X put.news.head.conf -- "sed -f script-file" to alter in the headerX of a news message (this may need to beX tailored for your site see "man sed"X rpost.conf -- not used in this versionX rpost.sm.conf -- parameters passed to the program rpostX Xsetup_inn.sh -- Setup a basic inn server see section SETUPsetup_suck.sh -- Setup the suck environment.X########################################################################SUCKXOnce the suck wrapper environment has been SETUP then the program canbe run from the news user command line with the following command:Xsuck/get.news.innXPlease read the suck README file for an explanation of how suckworks. This version of suck is different from the ones in the standardrelease in one important way. It uses configuration files instead ofembedding the commands into the scripts. This allows the owner of thescripts to alter them more easily and succinctly than directly editingthe script files.XThe configuration files are:XX.suckenvrc which is used to hold all environment variables whichX may need to be customised to run suck programs. It isX generated by "setup_suck.sh" and is linked ~/.suckenvrcX ~/suck/.suckenvrc. All the environment variables in this fileX can be altered by setting them in .profile, .bashrc or on theX command line before a suck script is run. This is possibleX because it uses the Bourne shell concept of ${parameter:=word}X which means that if the parameter has NOT already been set,X then use the string "word". So for example if the suck dirX was to be moved from /var/spool/news/suck /news/suck then byX setting the variable in ~/.profile "PATHSUCK=/news/suck;exportX PATHSUCK" this would over ride the setting /var/spool/news/suckX in ~/.suckenvrc.Xsuck.conf contains the command line parameters passed to the "suck"X program. All of the the variables are set in .suckenvrc with theX exception of SUCK_DEBUG which if set to "-D" will cause "suck"X to create a debug file called debug.suck in the directory inX which the script is run.Xput.news.body.conf contains part of a sed script executed in the scriptX put.news.sm. It fixes a bug in the original put.news.smX script. In the original script any line in the bodyX which started with the same string as those to beX stripped in the header would be stripped. This sedX script causes the body of the news message to beX passed on to the server without change.Xput.news.head.conf this sed script strips out header lines from newsX postings not wanted by the ISP server. This scriptX may need to be altered for use with different ISPX news servers.XX########################################################################CUSTOMISATIONXThe only script which may need alteration is put.news.head.confIf you need to stop a header line being uploaded onto the serveradd it at the end of the file. The format is "/^sting/d" where "^" is a sed symbol which only match string from the start of aX (header) line"string" should be replaced with the header id to be removed"d" is a sed command to delete the line.XIf you install a new inn system, then it may be necessary to edit theX.suckenvrc or rerun setup_suck but that is beyond the scope of thisarticle.X########################################################################SETUPXThis directory contains a number of files to help set up an inn newsserver so that it can download and upload news using the "suck".XThe two setup files which should be run one after the other are:i) setup_inn.shii) setup_suck.shXsetup_inn.sh should be run if the innd system has not been set up. ThisX script will do a minimum setup which will allow "suck"X to work, but the innd control files probably need furtherX fettling by the news owner. The active file will need toX be updated with the required news groups. (See appendix 1)X the command line options for setup_inn.sh are:X-help usage: setup_inn.sh {-[Hh]elp|-u[ndo]|domainname}-undo will copy saved versions of the files back to their originalX positions"domainname" is the name of the local domain. If it is not entered asX a command line option it will be requested interactively.XThe files which are altered by setup_inn.sh are:in /etc/news:X inn.conf newsfeeds readers.conf storage.conf X The originals are stored in the same dir with theX extension inn_org.in /etc/lib/news:X if active does not exist: X activeX if history does not exist:X history history.dir history.hash history.index X history.n.dir history.n.hash history.n.index Xsetup_suck.sh sets up the suck environment by creating and modifying aX number of files. The most important of these areX ~/.suckenvrc. The command line options are:X-help usage: setup_suck.sh {-h[elp]|-H[elp_more]|-u[undo]-Help more detailed help (see Appendix 1)X.suckenvrc.nosuck_org###############################################################################Appendix 1X#############setup_suck.sh####usage: setup_suck.sh {-h[elp]|-H[elp_more]|-u[undo]}XThis script "setup_suck.sh" sets up a Redhat installation of suck foryour edification and gratification. It assumes that you have alreadyinstalled inn and suck using rpm. If you have not set up innd toyour personal setting then please run "setup_inn.sh" before running"setup_suck.sh". You should be logged in as news. To do this usethe substitute user program "su" to become root. Then "su" to news. Thisgets around the fact that news does not usually have a password. If youdo not have permission to become root then ask the root user to allowyou access to news by setting a password for news.su - # to substitute as rootsu - news # to substitute as newsXYou can override two of the variables which are created by this scriptby setting them at the command line BEFORE running this script:X var=sting;export var # where var is the environment variable and stringX # is the valueXThe variable which will allow this script to run without having to answerany in line questions is NNTPSERVER which is your ISP server name eg."news.theperfectisp.com"XThe other variable which can be set before this script is run is:PATHBIN this is used set the path to the version of"innconfval". innconfval sets most of the variables used by the innsystem. This script uses some of those variables to set up a resourcefile for suck.XThis script contains a number of hard coded variables at the top of thescript which can be changed manually before it is run.X NewsUser=news # the normal owner of inndX Verbose="-v" # set this to "" for less verbose outputX SuckEnvRc=.suckenvrc # the name of the resource file createdX # by this scriptX Org=nosuck_org # backup/recovery (-undo) extension X HostCmd="host -W 120" # delay command to activate dialup connectionXThe resource file created by this script can be found as a linked filein two places in the $HOME dir of the innd owner (usually news) and$HOME/suck. The usual name for this file is .suckenvrc.XFiles which are altered and are backed up under nosuck_org they are:X $HOME/suck/$SuckEnvRc (default name .suckenvrc)X $HOME/suck/$SuckEnvRc as it is linked to $HOME/suck/$SuckEnvRcX $HOME/suck/active-ignoreX $PATHETC/newsfeedsX $PATHDB/activeXIf the history file does not exist then one is created. It isNOT put back in to the original state if the -undo option is run.To crate the history db the following commands are run:X makehistoryX makedbz -iX cp -p $PATHDB/history.n.dir $PATHDB/history.dirX cp -p $PATHDB/history.n.hash $PATHDB/history.hashX cp -p $PATHDB/history.n.index $PATHDB/history.indexX makedbzX-h[elp] usage-H[elp] This page-u[ndo] will move the original contents of the files backX into place.X#############setup_inn.sh####usage: setup_inn.sh -h[elp]|-H[elp_more]|-u[ndo]|domainnameXThis script "setup_inn.sh" sets up a Redhat inn installation with thebasics that the suck setup script does not.XIt does this by looking if domain is set in /etc/news/inn.confXIf you do not enter a domain name as a command line argument,you will be asked for it interactively by the scrip. It isthe name of the domain you wish to be in, this is typically"yousubdomain.ISPdomain". You will be familiar with it as partof your email address. As an example suppose that your ISP givesyou an email address of fred.smith@thesmiths.freeserve.co.ukthen the string needed here is "thesmiths.freeserve.co.uk"XIf this script gets confused it will ERROR out and you will have tofigure out how to fix the error.XThis is only a basic setup and it will not be the final onewhich you need you MUST RTFM (Read the friendly manual).The files which are altered are:X /etc/news/inn.confX /etc/news/newsfeedsX /etc/news/readers.confX /etc/news/storage.confX-h[elp] usage-H[elp] This page-u[ndo] will move the original contents of the files backX into place.###############################################################################Appendix 2XHow to down load a list of active news groups from your ISP:------------------------------------------------------------X . ~/.suckenvrc X testhost $NNTPSERVER -a >active.ispXSee "man testhost" for more details.XHow to update the active file-----------------------------XTaken From The FAQXFrom: INN FAQ MaintainersNewsgroups: news.software.nntp,news.software.bSubject: INN FAQ Part 8/9: Appendix A: Norman's install guideFollowup-To: news.software.nntpSummary: This article is part 8 of a multi-part FAQ: Part 8: Norman's quick guide to getting started (assumes SunOS and other things), and misc. other things.XIV. MAINTENANCE OF INNX* 1. Adding new groups - see also Part IV, Section 3.b,:Xa. Type: "ctlinnd pause 'edit active'"Xb. Edit the active file. The format is:X groupname himark lomark flag.XSet himark to 0000000000 and lomark to 0000000001.XFor detailed description of flags, read the manX page for active. Editing the active file by handX is easy, but will not update the information inX that file active.times that some newsreaders
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -