📄 suck_040225.shar
字号:
X require to trace new newsgroups. Using ctlinndX command "newgroup" takes care of this problemX (see below). Editing the active file with anX editor has one drawback - the file active.timesX is not automatically updated. This creates problemsX for some newsreader (Trumpet being one of them) X that use this file to alert users to new groups.XUsing ctlinnd command "newgroup" (see Part IV.3.b)X corrects this problem. Xc. Run inncheck (see #11) to check the new active fileX for errors. Xd. Type: "ctlinnd reload active 'new active'".Xe. Type: "ctlinnd go 'edit active'".XX------------------------------[Source: INN FAQ Part 6 Archive-name: usenet/software/inn-faq/part6][Last Changed: $Date: 1997/07/01 01:25:41 $ $Revision: 2.21 $][Copyright: 1997 Heiko Rupp, portions by Tom Limoncelli, Rich Salz, et al.]XSubject: (6.3) Safe way to edit the "active" file?XXFirst of all, you could manipulate the active file using the ctlinnd"newgroup", "rmgroup" and "changegroup" commands. However, sometimesyou just need to do a lot of editing all at once:XThe following sequence is the shortest:Xctlinnd pause "edit active"X [do something to the active file]X inncheckX ctlinnd reload active "edit active"X ctlinnd go "edit active"XXSimple! No need to "flush" since the "pause" does that.X> What if I need to delete 3000 lines from my active file?XXI would definitely edit the active file manually (usingthe above procedure).X> What if I need to delete 10 lines from my active file?XXFor a couple quick changes, I recommend using "ctlinnd". This is alittle slow because all channels are closed and reopened after each"rmgroup", "newgroup", and "changegroup". However, it's easier thanremembering the above sequence.XDO NOT THROTTLE THE SERVER WHEN DOING MULTIPLE rmgroup COMMANDS. Thereis a bug in INN (all versions) that will shred your active file if youdo multiple "rmgroup" messages while the server if throttled. This isa common mistake. People think the "rmgroup"'s will go faster if theserver is throttled. It will go faster, it will also shred your activefile.XIf you have a large number of groups to remove or create, you can useawk to write a script to do the work for you.X% cat thelistX alt.foo.barX alt.delete.meX comp.sys.macX % awk <thelist '{ print "ctlinnd rmgroup " $1 }'X ctlinnd rmgroup alt.foo.barX ctlinnd rmgroup alt.delete.meX ctlinnd rmgroup comp.sys.macXXNow, you can either send the output of that to "| sh -x",or you can redirect the output to a file, and "source" thefile.XIf you want to create a bunch of newsgroups, the awkcommand might be like this:X% awk <thelist \X '{ print "ctlinnd newgroup " $1 " y user@host" }' | sh -xXXBe aware that news.daily also throttles the server at some time soverify the state of the server before doing ctlinnd {rm,new}group.XSHAR_EOF (set 20 04 02 09 13 04 13 'suck/README2'; eval "$shar_touch") && chmod 0444 'suck/README2' || $echo 'restore of' 'suck/README2' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'suck/README2:' 'MD5 check failed'3f70690711365e3fb5d02b27a7f30a9b suck/README2SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'suck/README2'`" test 16623 -eq "$shar_count" || $echo 'suck/README2:' 'original size' '16623,' 'current size' "$shar_count!" fifi# ============= suck/setup_inn.sh ==============if test -f 'suck/setup_inn.sh' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'suck/setup_inn.sh' '(file already exists)'else $echo 'x -' extracting 'suck/setup_inn.sh' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'suck/setup_inn.sh' &&#!/bin/bash################################################################################ @(#)setup_inn.sh Version: 1.4 Date: 04/02/07 23:50:16 Author: PBS# To contact the Author: lmrlnATbigfoot.com replace AT with @# Copyright (C) 2003 Philip Baird Shearer## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.## This text is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# URL: http://www.gnu.org/copyleft/gpl.html#SEC3################################################################################ Description# One off customisation of inn so that it can be used by suck.# Only to be run if inn has not been customised already.## History# 12 Nov 2002 Working Version ################################################################################ These variables can be altered for example if the user name for the# owner of innd is not news then alter it here#########################NewsUser=newsEnvTmp=""Org=inn_org###############################################################################print_fn(){X if [ "$Verbose" == "-v" ]X thenX echo $*X fi}###############################################################################usage_fn(){X echo "usage: $SN -h[elp]|-H[elp_more]|-u[ndo]|domainname" 2>&1}###############################################################################introduction_fn(){cat <<- _EOBXX This script "$SN" sets up a Redhat inn installation with theX basics that the suck setup script does not.X X It does this by looking if domain is set in $PATHETC/inn.confXX If you do not enter a domain name as a command line argument,X you will be asked for it interactively by the scrip. It isX the name of the domain you wish to be in, this is typicallyX "yousubdomain.ISPdomain". You will be familiar with it as partX of your email address. As an example suppose that your ISP givesX you an email address of fred.smith@thesmiths.freeserve.co.ukX then the string needed here is "thesmiths.freeserve.co.uk"XX If this script gets confused it will ERROR out and you will have toX figure out how to fix the error.XX This is only a basic setup and it will not be the final oneX which you need you MUST RTFM (Read the friendly manual).X The files which are altered are:X $PATHETC/inn.confX $PATHETC/newsfeedsX $PATHETC/readers.confX $PATHETC/storage.confXX -h[elp] usageX -H[elp] This pageX -u[ndo] will move the original contents of the files backX into place._EOB}################################################################################who_am_i_fn(){X WHOAMI=`which whomaix 2>/dev/null`X if [ $? -ne 0 ]X thenX WHOAMI=`which id 2>/dev/null`X if [ $? -ne 0 ]X thenX echo "ERROR:$SN:who_am_i_fn:1: could not find programs whoami or id -- bailing out" 1>&2X return 1 X fiX WHOAMI="$WHOAMI -u -n"X fiXX $WHOAMIX if [ $? -ne 0 ]X thenX echo "ERROR:$SN:who_am_i_fn:2: do not know which user you are -- bailing out" 1>&2X return 1X fiX return 0}################################################################################set_env_fn(){X EnvTmp=$1X shiftXX if [ "$EnvTmp" != "" ]X thenX return 0X fiXX /bin/echo -n "$*"XX while [ -z "$EnvTmp" ]X doX read EnvTmpX doneXX set $EnvTmpX return 0}################################################################################set_inn_conf_path_fn(){X INN_CONF=${INN_CONF:=/etc/news/inn.conf}X while [ ! -f "$INN_CONF" ]X doX set_env_fn "" "Please enter the PARENT DIR of inn.conf: "X INN_CONF=$EnvTmp/inn.confX if [ ! -f $INN_CONF]X thenX print_fn "could not find $INN_CONF"X fiX done}################################################################################get_innconf_fn(){X grep $1 $INN_CONF | awk '{print $2;}'}################################################################################get_innconf_vars(){X PATHBIN=${PATHBIN:=`get_innconf_fn pathbin`}X if [ ! -x $PATHBIN/innconfval ]X thenX return 1X elseX #X ## if the tool exists use itX #X $PATHBIN/innconfval -s >/tmp/$SN.$$X #X ## include inn environment variablesX #X. /tmp/$SN.$$ X rm /tmp/$SN.$$X fiXX return 0}################################################################################all_innconf_set_fn() {set "$DOMAIN" XX while [ $1 ]X doX shiftX if [ $# -eq 0 ]X thenX return 0X fiX doneXX return $#}################################################################################display_innconf_fn(){Xcat << _EOBX DOMAIN=$DOMAIN_EOB}#################################################################################Main####SN=`basename $0`###################################################################turn off verbose if not #####case $# in 0)X Verbose="-v";;*) X case $1 inX -* )X ;;X * )X Verbose=${SUCK_VERBOSE:="-v"}X ;;X esac;;esac##################################################################print_fn "lets see who i am:"WHOAMI=`who_am_i_fn`if [ $? -ne 0 ]thenX exit 1fiif [ "$WHOAMI" != "$NewsUser" ]thenX echo "ERROR:$SN:main:10:user $WHOAMI is NOT NewsUser $NewsUser -- bailing out" 1>&2 X exit 1fiprint_fn "I am $WHOAMI"X################################################################### set up inn environment variables by looking in the INN_CONF file#######################################set_inn_conf_path_fnprint_fn "Setting up variables based on $INN_CONF"get_innconf_varsif [ $? -ne 0 ]thenX echo "ERROR:$SN:main:20:$PATHBIN/innconfval failed, check inn.conf -- bailing out" 1>&2 X exit 1fiX### Add bin dir for inn to the PATH variable so that## other commands can be called without the path variable## needing to be prepended to each one#PATH=$PATHBIN:${PATH}X################################################################### command line##############case $# in0 );;1 )X case $1 inX -h* )X usage_fnX exit 0X ;;X -H*)X usage_fnX introduction_fnX exit 0X ;;X -u* )X LIST="X inn.confX newsfeedsX readers.confX storage.confX "XX cd $PATHETCXX for name in $LISTX doX if [ -f ${name}.$Org ]X thenX mv ${name}.$Org ${name}X fiX doneX exit 0X ;;X *)X domain=$1X ;;X esac;;* )X usage_fnX exit 1;;esacX##################################################################if [ "$Verbose" == "-v" ] thenX introduction_fnfi##################################################################print_fn "checking the domain line in $PATHETC/inn.conf"########cd $PATHETCif [ $? -ne 0 ]thenX echo "ERROR:$SN:main:20:cd $PATHETC failed -- bailing out" 1>&2X exit 1fiXif [ "$DOMAIN" == "" ]thenX DOMAIN=$domainX while [ "$DOMAIN" == "" ]X doX set_env_fn "" "Please enter the local domain name: "X DOMAIN=$EnvTmpX doneXX if [ ! -f inn.conf.$Org ]X thenX mv inn.conf inn.conf.$OrgX sed \X -e "s/^domain:.*/domain: $DOMAIN/" \X -e "s/^organization:.*/organization: InterNetNews site $DOMAIN/" \X -e "s~^pathnews:.*~pathnews: $HOME~" \X -e "s/^#*pathhost:.*/pathhost: $DOMAIN/" \X -e "s/^server:.*/server: $DOMAIN/" \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -