dslinux/user/dialog/samples/copifuncs admin.funcs common.funcs copi.funcs copi.ifman1 copi.ifman2 copi.ifmcfg2 copi.ifmcfg4 copi.ifmcfg5 copi.ifpoll1 copi.ifpoll2 copi.ifreq1 copi.ifreq2 copi.rcnews copi.sendifm1 copi.sendifm2 copi.trnrc copi.wheel ifpatch
stsp
stsp at user.in-berlin.de
Mon Oct 23 22:59:36 CEST 2006
Update of /cvsroot/dslinux/dslinux/user/dialog/samples/copifuncs
In directory antilope:/tmp/cvs-serv17426/samples/copifuncs
Added Files:
admin.funcs common.funcs copi.funcs copi.ifman1 copi.ifman2
copi.ifmcfg2 copi.ifmcfg4 copi.ifmcfg5 copi.ifpoll1
copi.ifpoll2 copi.ifreq1 copi.ifreq2 copi.rcnews copi.sendifm1
copi.sendifm2 copi.trnrc copi.wheel ifpatch
Log Message:
Adding pristine copy of dialog-1.0-20060221 so I can branch from it.
--- NEW FILE: copi.ifreq1 ---
#!/usr/bin/perl
$ver = "0.4";
#
# this perl script is designed for the ifmail package by eugene grosser.
#
# request a file (first argument) from a fido-node (second argument),
# don't forget to quote if you use wildcards, e.g.:
# ifreq 'files*' 2:2410/305
# or
# ifreq 'files newfile' 2:2410/305
#
# this perl script does only add an entry to the corresponding flo-file,
# the mailer ifcico is not started!
#
# rasca, berlin 1994 (rasca at marie.physik.tu-berlin.de, 2:2410/305.4)
#
# multi-zone support added by
# Roland Rosenfeld 15.05.1994 (roland at p13.flokiste.fido.de, 2:2450/300.13)
--- NEW FILE: copi.ifmcfg5 ---
# PhoneTrans lines provide rules to change phone prefixes to make local
# or long-distance calls. In the example below, my country code is 7,
# and local dialing area is 095. From the numbers starting with "7-095-"
# the prefix is stripped and the 7-digit remainder is dialed. For
# the numbers starting with "7-" but not with "7-095-", the country prefix
# "7-" is stripped and the long-distance dialing prefix "8W" substituted.
# For the numbers not matching any of the above, international
# call is performed: international dialing prefix "8W10" is prepended
# to the unmodified 11-digit number. Generally, the syntax is:
# "PhoneTrans <what-to-strip> / <what-to-substitute-instead>"
#PhoneTrans 7-095- /
#PhoneTrans 7- / 8W
#PhoneTrans / 8W10
--- NEW FILE: copi.ifreq2 ---
# this is the base directory, where the req-files are stored and the
# default outbound
$flo_path = "/var/spool/ifmail";
$outbound = "/outb"; # don't be confused, it means "/var/spool/ifmail/outb"
# end of configuration #############################################
# main()
#
if ((@ARGV < 1) || @ARGV > 2 || $ARGV[0] eq "-?") {
&usage;
} elsif ($ARGV[1] ne "") {
$node = $ARGV[1];
}
$file = $ARGV[0];
if (! ($node =~ /\d+:\d+\/\d+/)) {
die "Wrong address: $node!!!";
}
($zone, $netnode) = split (/:/, $node);
$reqfile = sprintf("%04x%04x", split(/\//, $netnode));
if ($reqfile eq "00000000") {
print ("can't resolve the fido address \"$node\"\n");
&usage;
} else {
if ( $zone == 2 ) {
$reqfile = $flo_path . $outbound . "/" . $reqfile . ".req";
} elsif ( $zone < 7 ) {
$reqfile = $flo_path . $outbound . ".00$zone/" . $reqfile . ".req";
} else {
$outbound = "";
open (CONFIG, "< $config") || die "can't open $config";
while ($_ = <CONFIG>) {
if ( /^address.*$zone:.*\@(\w*)/ ) { $outbound = $1; }
}
if ( $outbound eq "" ) {
die "No Zone $zone found in $config";
}
$reqfile = $flo_path . "/$outbound/" . $reqfile . ".req";
}
# seperate the file names of the first argument
@files = split (/\s+/, $ARGV[0]);
# open the flofile for appending
open(FLOFILE, ">>" . $reqfile) || die "can't open $reqfile";
while (@files) {
print (FLOFILE shift(@files), "\n");
}
close(FLOFILE);
print ("--- fido request $ver ---------------------------\n");
print ("requesting \"$file\" from fido-node $node\n");
print ("--- executing ifstat .. ------------------------\n");
system("ifstat");
}
#
# subroutine "usage"
#
sub usage {
printf ("--- fido request %s -------------\n", $ver);
printf ("usage: ifreq <file> [<3-d address>]\n");
printf ("e.g. : ifreq FILES 2:2410/305\n");
exit 1;
}
--- NEW FILE: copi.ifpoll2 ---
# Packets backup directory - You have to CREATE this directory
BAK=/var/spool/ifmail/BAK
# logfile of ifcico
IFLOG=/var/log/ifmail/sysiflog
# log archive
IFLOGARC=/var/log/ifmail/TheLog
# owner of "ifcico"
IFCICO_OWNER=fnet
# how often should i try to call NODE?
MaxTry=30
# delay between outgoing calls in seconds
DELAY=10
# where to log processing - file or tty/console
INFO_TTY=/dev/console
# Lets backup the log and use a new one
if [ -e $IFLOG ]; then
echo Rearranging logs...
cat $IFLOG >> $IFLOGARC
cp /dev/null $IFLOG
fi
echo "`date \"+%b %d %T\"` ifpoll[$$]: starting" # >> $INFO_TTY
# remember me, not to run as root..
#
if [ `whoami` != "$IFCICO_OWNER" ]; then
echo "*** run $0 as the owner of ifcico ***"
echo "`date \"+%b %d %T\"` ifpoll[$$]: wrong uid (rc 2)" # >> $INFO_TTY
exit 2
fi
# argv[1] is the optional node to call
#
if [ "$1" != "" ]; then
if [ "$1" = "-?" ] || [ "$1" = "-h" ]; then
echo "usage: ifpoll [<node>]"
exit 3
else
NODE=$1
fi
fi
# let's pack the fido stuff..
#
$FIDOPATH/ifpack
# loop until ifcico could connect the node or MaxTry is encountered
#
i=1; errlv=1
while let 'i <= MaxTry' && let 'errlv != 0'
do
echo -n "`date \"+%b %d %T\"` ifpoll[$$]: $i. try ($NODE) " # >> $INFO_TTY
#
# start ifcico in master mode ..
#
$FIDOPATH/ifcico -r 1 $NODE
errlv=$?
if [ $errlv != "0" ]; then
echo "failed" # >> $INFO_TTY
if [ $i != $MaxTry ]; then
sleep $DELAY
fi
let i=i+1
else
echo "ok :)" # >> $INFO_TTY
fi
done
# if the poll was fine, unpacking..
#
if [ $errlv = "0" ]; then
echo "`date \"+%b %d %T\"` ifpoll[$$]: unpacking.. " # >> $INFO_TTY
cp -f /var/spool/ifmail/inb/*.* $BAK
$FIDOPATH/ifunpack
# add here some additional lines for processing tic files or
# incoming file-lists or simular..
else
# write me a mail about the failed poll
tail --lines=20 $IFLOG | elm -s "ifpoll: failed" $IFCICO_SYSOP >/dev/null
fi
echo "`date \"+%b %d %T\"` ifpoll[$$]: finished (rc $errlv)" # >> $INFO_TTY
# Collect some infos...
echo ""
echo "*** Outgoing File Transfer Stats: ***"
grep sent $IFLOG
echo "*** Incoming File Transfer Stats: ***"
grep received $IFLOG
echo ""
echo "---->> New mail: <<-----"
grep echomail $IFLOG
echo "---->> Personal mail: <<-----"
grep "mail from" $IFLOG
echo ""
# return the errorlevel of ifcico
exit $errlv
--- NEW FILE: copi.ifpoll1 ---
#!/bin/sh
# ver 0.7
# ifpoll, poll my boss node or the node given as argument 1
#
# i start this shell script every day by crond, but you can
# start it also by hand :) start it as the owner of ifcico.
# rasca, berlin 1993 (Rasca Gmelch, 2:2410/305.4)
#
# where "ifcico" and "ifpack" reside
--- NEW FILE: copi.ifmcfg4 ---
ModemHangup +++ATH\r
ModemOK OK
ModemConnect CONNECT
ModemError BUSY
ModemError NO\sCARRIER
ModemError NO\sDIAL
ModemError RING\r
ModemError ERROR
# Call options (time, address and nodelist flag dependant)
# All matching are applied in the order they are specified.
# Possible options are "[No]Call", "[No]Hold", "[No]PUA", "[No]EMSI",
# "[No]WaZOO", "[No]Freqs", "[No]Zmodem", "[No]ZedZap", "[No]Janus",
# "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 handshake, not for
# the transfer scheme. FTS-0001 handshake and DietIFNA scheme cannot
# be disallowed (because they are mandatory by standart). "Hold"
# means really hold "hold" type packets and files: do not send them
# if our system initiated the session, "NoHold" means send "hold"
# packets when our system initiated the session. "NoPUA" stands for
# "No PickUp All", i.e. PUP ("Pick Up Primary"). NoCall means do not
# perform outbound call. This flag has no effect on the nodes
# explicitly specified in the command line.
# Default options are "everything allowed".
# options ((!CM) & time Any0700-0200) Nocall
#options (time Any0900-2100 & ! address 2:5020/*) Nocall
# EMSI data for this node
# From this line on values CANNOT be prefixed with logical expression
# For now, escaping of '}' and ']' unimplemented, try to avoid these
# characters please!
--- NEW FILE: copi.rcnews ---
#! /bin/sh
## $Revision: 1.1 $
## News boot script.
## =()<. @<_PATH_SHELLVARS>@>()=
. /usr/lib/news/innshellvars
## Pick ${INND} or ${INNDSTART}
WHAT=${INNDSTART}
## Set to true or false
DOINNWATCH=false
MAIL="${MAILCMD} -s 'Boot-time Usenet warning on `hostname`' ${NEWSMASTER}"
## RFLAG is set below; set FLAGS as appropriate.
RFLAG=""
FLAGS="-i0 -c0"
## Clean shutdown?
if [ -f ${SERVERPID} ] ; then
( echo 'INND: PID file exists -- unclean shutdown!' >/dev/console )
RFLAG="-r"
fi
if [ ! -f ${NEWSLIB}/.news.daily ] ; then
echo 'No .news.daily file; need to run news.daily?' | eval ${MAIL}
else
case `find ${NEWSLIB} -name .news.daily -mtime +1 -print 2>/dev/null` in
"")
;;
*)
echo 'Old .news.daily file; need to run news.daily?' | eval ${MAIL}
;;
esac
fi
## Active file recovery.
if [ ! -s ${ACTIVE} ] ; then
if [ -s ${NEWACTIVE} ] ; then
mv ${NEWACTIVE} ${ACTIVE}
else
if [ -s ${OLDACTIVE} ] ; then
cp ${OLDACTIVE} ${ACTIVE}
else
( echo 'INND: No active file!' >/dev/console )
exit 1
fi
fi
RFLAG="-r"
# You might want to rebuild the DBZ database, too:
#echo "cd ${NEWSLIB} \
# && makehistory -r \
# && mv history.n.dir history.dir \
# && mv history.n.pag history.pag" | su ${NEWSUSER}
fi
## Remove temporary batchfiles and lock files.
( cd ${BATCH} && rm -f bch* )
( cd ${LOCKS} && rm -f LOCK* )
( cd ${TEMPSOCKDIR} && rm -f ${TEMPSOCK} )
rm -f ${NEWSCONTROL} ${NNTPCONNECT} ${SERVERPID}
## Start the show.
( echo 'Starting innd.' >/dev/console )
eval ${WHAT} ${RFLAG} ${FLAGS}
# Gee, looks like lisp, doesn't it?
${DOINNWATCH} && {
echo "( ( sleep 60 ; ${INNWATCH} ) & )" | su ${NEWSUSER}
}
RMFILE=${MOST_LOGS}/expire.rm
if [ -s ${MOST_LOGS}/expire.rm ] ; then
( echo "Removing articles from pre-downtime expire run." >/dev/console )
(
echo 'System shut down during expire. Unlinking articles listed in'
echo ${RMFILE}
) | eval ${MAIL}
echo "${NEWSBIN}/expirerm ${RMFILE}" | su ${NEWSUSER} &
fi
--- NEW FILE: admin.funcs ---
#!/bin/bash
# $Id: admin.funcs,v 1.1 2006-10-23 20:59:33 stsp Exp $
#
# ComeOn Point Functions! v0.9.2
# - usate da vari altri moduli ComeOn Point...
#
# AUTHOR: Beppe (beppe.dem at nsm.it)
#
# 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 program 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Args: source_file, domain, nldir
install_nodelist() {
NODELIST="$1"
FOR_DOMAIN="$2"
NODEDIR="$3"
dialog --backtitle "$TITLE" --infobox "Installo la nodelist '$NODELIST' per il domain $FOR_DOMAIN, attendere prego..." 0 0
cp "$NODELIST" $NODEDIR/$FOR_DOMAIN.ndl
chown fnet.uucp $NODEDIR/$FOR_DOMAIN.ndl
echo "y" | su -l fnet -c "ifindex" >/dev/null
}
# Args: source, dest
add_alias() {
SOURCE=$1
DEST=$2
ALIASES=/etc/aliases
ENTRY="`grep $SOURCE: $ALIASES`"
dialog --backtitle "$TITLE" --infobox "Creo un alias per redirigere le mail per $SOURCE a $DEST ..." 0 0
if [ ! "$ENTRY" ]
then
echo "$SOURCE: $DEST" >>$ALIASES
else
OLDDEST="`echo $ENTRY | cut -f2 -d:`"
mkstemp alias
sed /"$SOURCE:"/s/"$OLDDEST"/" $DEST"/ $ALIASES >$tmp_alias
cat $tmp_alias >$ALIASES
rm $tmp_alias
fi
mkaliases >/dev/null
}
# Args: Areas_pathname, newsgroup, area_ftn, description [, expire_days]
# Returns: 1 - innd not running
# 2 - already existing newsgroup
# 3 - already existing ftn_area
create_newsgroup() {
AREAS="$1"
NEWSGROUP="$2"
AREA="$3"
DESCRIPTION="$4"
EXPIRE_DAYS="$5"
NEWSGROUPS=~news/newsgroups
EXPIRECTL=~news/expire.ctl
dialog --backtitle "$TITLE" --infobox "Creo il newsgroup $NEWSGROUP per contenere i messaggi dell'area $AREA..." 0 0
if [ ! "`ps ax | grep ~news/etc/innd`" ]
then
return 1
fi
if [ "`cut $NEWSGROUPS -f1 | cut -f1 -d\ | grep -x $NEWSGROUP`" ]
then
return 2
fi
if [ "`cut $AREAS -f1 | cut -f1 -d\ | grep -x $AREA`" ]
then
return 3
fi
su -l news -c "bin/ctlinnd newgroup $NEWSGROUP" >/dev/null
echo -e "$NEWSGROUP\t$DESCRIPTION" >> $NEWSGROUPS
echo -e "$AREA\t$NEWSGROUP\t`echo $NEWSGROUP | cut -f1 -d.`" >> $AREAS
if [ "$EXPIRE_DAYS" ]; then
echo "$NEWSGROUP:A:2:$EXPIRE_DAYS:$EXPIRE_DAYS" >> $EXPIRECTL
fi
chown news.news $NEWSGROUPS $EXPIRECTL
chmod 440 $EXPIRECTL
chown fnet.uucp $AREAS
}
# Returns: 0 if ok, 1 if (innd not running), 2 if (no that newsgroup)
# Args: Areas_pathname, newsgroup
rmgroup() {
AREAS=$1
NEWSGR=$2
NEWSGROUPS=~news/newsgroups
EXPIRE=~news/expire.ctl
dialog --backtitle "$TITLE" --infobox "Elimino il newsgroup $NEWSGR ed i messaggi in esso contenuti, attendere prego. Questa operazione potrebbe durare alcuni minuti." 0 0
if [ ! "`ps x | grep ~news/etc/innd`" ]
then
return 1
fi
if [ ! "`cut -f1 $NEWSGROUPS | cut -f1 -d\ | grep -x $NEWSGR`" ]
then
return 2
else
# Updating newsgroups file
if [ -f $NEWSGROUPS ]
then
mkstemp groups
mv $NEWSGROUPS $NEWSGROUPS~
grep -v $NEWSGR $NEWSGROUPS~ >$tmp_groups
mv $tmp_groups $NEWSGROUPS
else
:> $NEWSGROUPS
fi
chown news.news $NEWSGROUPS
# Updating Areas file
if [ -f $AREAS ]
then
mkstemp areas
mv $AREAS $AREAS~
grep -v $NEWSGR $AREAS~ >$tmp_areas
mv $tmp_areas $AREAS
else
:> $AREAS
fi
chown fnet.uucp $AREAS
# Updating expire.ctl file
if [ -f $EXPIRE ]
then
mkstemp expire
mv $EXPIRE $EXPIRE~
grep -v "$NEWSGR:" $EXPIRE~ >$tmp_expire
mv $tmp_expire $EXPIRE
else
:> $EXPIRE
fi
chown news.news $EXPIRE
chmod 444 $EXPIRE
# Remove pending articles
echo -e "\n$NEWSGR:A:0:0:0" >>$EXPIRE
su -l news -c "bin/news.daily" >/dev/null
mkstemp expire
grep -v $NEWSGR $EXPIRE >$tmp_expire
mv $tmp_expire $EXPIRE
chown news.news $EXPIRE
chmod 444 $EXPIRE
# Updating active file
su -l news -c "bin/ctlinnd rmgroup $NEWSGR" >/dev/null
fi
}
# Args: newsgroups_wildmat, days_to_keep
set_expire_time() {
NEWSGROUP="$1"
KEEPDAYS="$2"
EXPIRE=~news/expire.ctl
dialog --backtitle "$TITLE" --infobox "Imposto a $KEEPDAYS il numero di giorni di mantenimento dei messaggi del newsgroup $NEWSGROUP..." 0 0
if [ ! -f $EXPIRE ]
then
:> $EXPIRE
elif [ "`cut $EXPIRE -s -f1 -d: | grep -x $NEWSGROUP`" ]
then
mkstemp expire
grep -v "$NEWSGROUP:" $EXPIRE >$tmp_expire
mv $tmp_expire $EXPIRE
fi
echo -e "\n$NEWSGROUP:A:2:$KEEPDAYS:$KEEPDAYS" >>$EXPIRE
chown news.news $EXPIRE
chmod 444 $EXPIRE
}
--- NEW FILE: copi.funcs ---
#!/bin/bash
# $Id: copi.funcs,v 1.1 2006-10-23 20:59:33 stsp Exp $
# ComeOn Point Functions! v0.9.2
# - usate da vari altri moduli ComeOn Point...
#
# AUTHOR: Beppe (beppe.dem at nsm.it)
#
# 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 program 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
[...1264 lines suppressed...]
OK=0
else
echo -e ".`echo $AKA | cut -f4 -d.`\t\t$AKA!%s" >>$FTNPATHS
fi
done
# misc section
chmod 1775 /var/spool/mail
chgrp mail /var/spool/mail
cd $SMAIL
touch forward
/usr/lib/smail/mkdbm forward
# reload sendmail
killall sendmail 2>/dev/null
/usr/sbin/sendmail -bd -q15m # if inetd handles smtp port, this will not load
}
--- NEW FILE: copi.sendifm1 ---
#! /bin/sh
## $Revision: 1.1 $
## SH script to send UUCP batches out.
## =()<. @<_PATH_SHELLVARS>@>()=
. ~news/innshellvars
PROGNAME=`basename $0`
LOCK=${LOCKS}/LOCK.${PROGNAME}
LOG=${MOST_LOGS}/${PROGNAME}.log
MAXJOBS=200
UUXFLAGS="- -r -gd"
## Start logging.
test ! -f ${LOG} && touch ${LOG}
chmod 0660 ${LOG}
exec >>${LOG} 2>&1
echo "${PROGNAME}: [$$] begin `date`"
cd ${BATCH}
## Anyone else there?
trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15
shlock -p $$ -f ${LOCK} || {
echo "${PROGNAME}: [$$] locked by [`cat ${LOCK}`]"
exit 0
}
## Who are we sending to?
if [ -n "$1" ] ; then
LIST="$*"
else
LIST=`ls /usr/spool/news/out.going|egrep "f[0-9]*.n[0-9]*$"`
fi
case ${HAVE_UUSTAT} in
DONT)
TEMP=${TMPDIR}/uuq$$
uuq -h |tr -d : >${TEMP}
;;
esac
## Do the work...
for SITE in ${LIST}; do
## See if any data is ready for host.
BATCHFILE=${SITE}.uucp
if [ -f ${SITE}.work ] ; then
cat ${SITE}.work >>${BATCHFILE}
rm -f ${SITE}.work
fi
mv ${SITE} ${SITE}.work
ctlinnd -s -t30 flush ${SITE} || continue
cat ${SITE}.work >>${BATCHFILE}
rm -f ${SITE}.work
if [ ! -s ${BATCHFILE} ] ; then
echo "${PROGNAME}: [$$] no articles for ${SITE}"
rm -f ${BATCHFILE}
continue
fi
## Get the compression flags.
echo "${PROGNAME}: [$$] begin ${SITE}"
case "${SITE}" in
phreak)
COMPRESS="compress"
;;
*)
COMPRESS="gzip"
;;
esac
time batcher \
--- NEW FILE: copi.ifmcfg2 ---
# Transport programs for mail and news, used by iftoss
sendmail /usr/lib/sendmail -f $F $T
rnews /usr/lib/news/rnews
# Unpackers, used by ifunpack.
# $F expands to archieve file name
unzip /usr/bin/unzip -oq $F
unarj /usr/bin/unarj e $F
#unarc /usr/bin/unpack $F
unzoo /usr/bin/zoo -extract $F
unlzh /usr/bin/lharc -x $F
# Packer program, used by ifpack
# $F expands to archieve file name, $P - to list of packet names
packer /usr/bin/zip $F $P
# Maximum arcmail file size, will start new arcmail file if exceeds
maxfsize 65000
# Maximum packet size, ifmail/ifnews will start new packet if exeeds.
# .out files are NOT created if nonzero specified, you must run ifpack
# to make packets out. (unimplemented)
maxpsize 65000
# cnews log file and (temporary) database for seen-bys
newslog /usr/lib/news/log
msgidbm /tmp/ifmsgids
# From this line on, values may be prefixed by a logical expression in
# round brackets. Operators are: '!', '&', '|', 'Xor'.
# Possible elements are:
# - Nodelist flags (like "CM", "MNP", "V32" etc.)
# - speed <operator> <numeric>
# where <operator> is '=', '!=', '<', '>', '<=', '>='
# - address <wildcard>
# where <wildcard> is an (possibly incomplete) fidonet address,
# e.g. "5020/*"
# - time <interval>[,<interval>,...]
# where <interval> is a day spec. with optional time spec., e.g.
# Wk2000-0900,Sat1800-0000,Sun
# - phone <prefix>
# e.g. "phone 7-095-"
# Dialing parameters
# of multiple "ModemPort", "ModemReset", "ModemDial", "ModemHangup" lines,
# first matching is used.
# of multiple "PhoneTrans", "ModemConnect", "ModemError" lines, all matching
# are used.
# In send and expect strings, following substitutions are made:
# \\ '\' character
# \r carriage return (0x0d)
# \n new line (0x0a)
# \t tab (0x09)
# \b backspace (0x08)
# \s space (0x20)
# \NNN (where N is an octal digit) - character with octal code NNN
# \d 1 second delay (send strings only)
# \p 1/4 second pause (send strings only)
# \T translated telephone no. (send strings only)
# \D untranslated telephone no. (send strings only)
# ModemPort present a blank-separated list of ports with possible speed
# extention (separated by colon); if speed is prefixed with 'L', it is
# a "locked" port speed, otherwise it is a maximum speed to be set, while
# actual speed is taken from the nodelist. If speed is omitted (or set
# to zero), previous port speed is not changed.
#ModemPort (time Any0000-0900,Sat,Sun) ttyS0
#ModemPort cua0:L38400
--- NEW FILE: copi.sendifm2 ---
${SITE} ${BATCHFILE}
echo "${PROGNAME}: [$$] end ${SITE}"
done
case ${HAVE_UUSTAT} in
DONT)
rm -f ${TEMP}
;;
esac
## Remove the lock file.
rm -f ${LOCK}
echo "${PROGNAME}: [$$] end `date`"
--- NEW FILE: copi.wheel ---
#!/bin/bash
# $Id: copi.wheel,v 1.1 2006-10-23 20:59:34 stsp Exp $
mkstemp size
dialog --print-maxsize 2>$tmp_size
ROWS="`cut $tmp_size -f1 -d, | cut -f2 -d:`"
COLS="`cut $tmp_size -f2 -d,`"
rm $tmp_size
# Takes an integer, multiplies it for COLS, divides for 132
scalex() {
echo $[$1*$COLS/132]
}
scaley() {
echo $[$1*$ROWS/60]
}
dialog --backtitle "$TITLE" --no-shadow \
--begin `scaley 27` `scalex 98` --infobox "pushd /var/log >/dev/null" 0 0 --and-widget \
--begin `scaley 35` `scalex 95` --infobox "mkdir -p news -m 755" 0 0 --and-widget \
--begin `scaley 45` `scalex 86` --infobox "chown news.news news" 0 0 --and-widget \
--begin `scaley 48` `scalex 78` --infobox "cd /var/log/news" 0 0 --and-widget \
--begin `scaley 51` `scalex 61` --infobox "mkdir -p OLD -m 755" 0 0 --and-widget \
--begin `scaley 52` `scalex 47` --infobox "chown news.news OLD" 0 0 --and-widget \
--begin `scaley 51` `scalex 40` --infobox "cd /var/spool" 0 0 --and-widget \
--begin `scaley 48` `scalex 25` --infobox "mkdir -p news -m 775" 0 0 --and-widget \
--begin `scaley 42` `scalex 13` --infobox "chown news.news news" 0 0 --and-widget \
--begin `scaley 35` `scalex 4` --infobox "cd /var/spool/news" 0 0 --and-widget \
--begin `scaley 27` `scalex 2` --infobox "CURMASK=`umask`" 0 0 --and-widget \
--begin `scaley 19` `scalex 4` --infobox "umask 02" 0 0 --and-widget \
--begin `scaley 11` `scalex 13` --infobox "mkdir -p out.going control junk in.coming" 0 0 --and-widget \
--begin `scaley 5` `scalex 25` --infobox "chown news.news out.going control junk in.coming" 0 0 --and-widget \
--begin `scaley 2` `scalex 37` --infobox "cd in.coming" 0 0 --and-widget \
--begin `scaley 1` `scalex 46` --infobox "mkdir -p bad tmp" 0 0 --and-widget \
--begin `scaley 2` `scalex 61` --infobox "chown news.news bad tmp" 0 0 --and-widget \
--begin `scaley 5` `scalex 76` --infobox "umask $CURMASK" 0 0 --and-widget \
--begin `scaley 11` `scalex 87` --infobox "ln -sf ~news /usr/local/lib/" 0 0 --and-widget \
--begin `scaley 18` `scalex 95` --infobox "ln -sf ~news/inews /usr/bin/" 0 0 --and-widget \
--begin `scaley 26` `scalex 97` --infobox "chmod 1777 /var/tmp" 0 0 --and-widget \
--begin `scaley 34` `scalex 95` --infobox "cd ~news" 0 0 --and-widget \
--begin `scaley 42` `scalex 87` --infobox "touch history history.dir history.pag errlog log" 0 0 --and-widget \
--begin `scaley 47` `scalex 76` --infobox "chown news.news history* log errlog" 0 0 --and-widget \
--sleep 1 --infobox "Creating spooling and logging directories and files..." 0 0 --and-widget \
--begin `scaley 51` `scalex 78` --infobox "chmod 664 history* log errlog" 0 0 --and-widget \
--begin `scaley 52` `scalex 60` --infobox "echo \"control 0000000000 0000000001 y\" > active" 0 0 --and-widget \
--begin `scaley 51` `scalex 42` --infobox "echo \"junk 0000000000 0000000001 y\" >> active" 0 0 --and-widget \
--begin `scaley 48` `scalex 26` --infobox "chown news.news active" 0 0 --and-widget \
--begin `scaley 42` `scalex 13` --infobox "echo \"control 814573260 usenet\" > active.times" 0 0 --and-widget \
--begin `scaley 35` `scalex 4` --infobox "echo \"junk 814573260 usenet\" >> active.times" 0 0 --and-widget \
--begin `scaley 27` `scalex 2` --infobox "chown news.news active.times" 0 0 --and-widget \
--begin `scaley 19` `scalex 4` --infobox ":>newsgroups" 0 0 --and-widget \
--begin `scaley 11` `scalex 12` --infobox "chown news.news newsgroups" 0 0 --and-widget \
--begin `scaley 6` `scalex 25` --infobox "popd >/dev/null" 0 0
sleep 1
--- NEW FILE: copi.ifman1 ---
#! /usr/bin/perl
#
# This is a utility script to manipulate Fidonet-related issues
# using Eugene Crosser's ifmail package
#
# Version 0.1
#
# (C) Michael Bravo and The Communication Tube, 1994
#
# You can do whatever you want with this script. I take no responsibility
# whatsoever in anything related to this script. If you make some useful
# additions to this, please think of sending them to me so I could partake
# of your wisdom.
#
# This script was written to help attaching and requesting files from the
# commandline, much like you do with Squish under DOS or OS/2. It is certainly
# not perfect - I used it as an exercise in Perl. It also probably lacks
# some other useful features, like ability to specify trunc/sent or kill/sent
# attributes etc etc. If you really want this or some other features
# implemented, write me at mbravo at tctube.spb.su or mbravo at octopus.spb.su
# and I will try to do what I can.
#
# Note - files don't get copied to any spool dir, so if you move attached
# files somewhere, they won't get sent.
#
# This script is supposed to read ifmail's config to determine where outbound
# directory and logfile are. The only two parameters to modify in most cases
# are below.
--- NEW FILE: copi.ifman2 ---
if ( getpwuid($<) ne $ifowner ) { print "You must be owner of ifmail\n"; exit 1; }
if ( (@ARGV < 3) || $ARGV[0] eq "-?" || $ARGV[0] eq "-h" ) {
&usage;
}
$ARGV[0] =~ tr/A-Z/a-z/;
$ARGV[3] =~ tr/A-Z/a-z/;
&parsecfg;
if ( $logfile ne "" ) {
open(LOG, ">>".$logfile) || die "Can't open logfile";
}
if (substr($ARGV[1], 0, 1) ne "/") {
$cwd=`pwd`;
chop $cwd;
$ARGV[1] = $cwd."/".$ARGV[1];
}
if ($ARGV[3] eq "" || $ARGV[3] eq "normal") {
$flavour = 'f';
} elsif ($ARGV[3] eq "crash") {
$flavour = 'c';
} elsif ($ARGV[3] eq "hold") {
$flavour = 'h';
} else {
print "Unknown flavour, assuming normal\n";
$flavour = 'f';
}
if ($ARGV[0] eq "send") {
&attach($ARGV[1], $ARGV[2]);
} elsif ($ARGV[0] eq "get") {
&request($ARGV[1], $ARGV[2]);
} else {
print "Unknown command, try ifman -h\n";
exit 1;
}
close(LOG);
exit 0;
#######################################################################
sub attach {
local($fspec, $address) = @_;
$floname = &resolve($address);
open(FLO, ">>".$outbound."/".$floname) || die "Can't open flo-file $outbound/$floname";
open(FIND, "find $fspec -print |") || die "Can't generate list of files";
if ( eof(FIND) ) {
print "No matching files, nothing to send\n";
exit 1;
}
while (<FIND>) {
chop;
$datestamp = `date \"+%D %T\"`;
chop $datestamp;
printf LOG "%s %s %s\n", $datestamp, $$, "ifman: sending $_ to $address";
printf FLO "%s\n", $_;
}
close(FLO);
close(FIND);
}
sub request {
local($fspec, $address) = @_;
$reqname = &resolve($address);
$reqname =~ s/\.[fch]lo/\.req/;
open(REQ, ">>".$outbound."/".$reqname) || die "Can't open req-file";
$datestamp = `date \"+%D %T\"`;
chop $datestamp;
printf LOG "%s %s %s\n", $datestamp, $$, "ifman: requesting $fspec from $address";
printf REQ "%s\n", $fspec;
close(REQ);
}
sub resolve {
local($addr) = @_;
if ( index($addr, ":") >=0 ) {
print "I cannot resolve addresses with zones!\n";
exit 1;
} elsif ( index($addr, "/") == -1 ) {
print "Not a valid address!\n";
exit 1;
}
($net, $node, $point) = split(/\/|\./, $addr);
if ( defined $point ) {
$pointdir = sprintf("%04x%04x.pnt", $net, $node);
if ( ! -e $outbound."/".$pointdir ) {
mkdir ($outbound."/".$pointdir, 0755) || die "Can't create point directory";
}
$flo = sprintf("0000%04x.%01slo", $point, $flavour);
return $pointdir."/".$flo;
} else {
$flo = sprintf("%04x%04x.%01slo", $net, $node, $flavour);
return $flo;
}
}
sub usage {
print "ifmail manager script\n";
print "usage: ifman <cmd> <filespec> <address> [flavour]\n";
print " commands: send, get\n";
print " flavours: normal, crash, hold. Default is normal.\n";
print "Only 2d addresses with points are supported - no zones!\n";
exit 1;
}
sub parsecfg {
open(CFG, $cfgfile) || die "Can't open ifmail config file";
while (<CFG>) {
chop;
if (/^#/) { next; }
if (/^outbound\s+(\S+)/) { $outbound = $1; }
if (/^logfile\s+(\S+)/) { $logfile = $1; }
}
close(CFG);
}
--- NEW FILE: common.funcs ---
#
# ComeOn Point Functions! v0.9.2
# - usate da vari altri moduli ComeOn Point...
#
# AUTHOR: Beppe (beppe.dem at nsm.it)
#
# 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 program 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
save() {
if [ -f $1 ]
then
mv $1 $1~
fi
}
# Returns $PKG_TO_REMOVE
find_incompatible_packages() {
dialog --backtitle "$TITLE" --infobox "Vediamo innanzitutto se c'e' qualche pacchetto di troppo ... ;-)" 0 0
PKG_TO_REMOVE=""
for i in sendmail smailcfg cnews
do
if [ -f /var/adm/packages/$i ]
then
PKG_TO_REMOVE="$PKG_TO_REMOVE $i"
fi
done
}
# Returns $PKG_TO_INSTALL
find_necessary_packages() {
dialog --backtitle "$TITLE" --infobox "Controlliamo se manca qualche pacchetto..." 0 0
PKG_TO_INSTALL=""
for i in tcpip mailx inn
do
if [ ! -f /var/adm/packages/$i ]
then
PKG_TO_INSTALL="$PKG_TO_INSTALL $i"
fi
done
}
# Args: user, editor
configure_trn() {
dialog --backtitle "$TITLE" --infobox "Configuro trn all'user $1..." 0 0
SHELL_USED="`basename \`cut /etc/passwd -f1,7 -d: | grep $1: | cut -f2 -d:\``"
USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $1: | cut -f2 -d:`"
TRNRC="$USER_HOME/.trnrc"
case $SHELL_USED in
bash)
if [ -f $USER_HOME/.bash_profile ]
then
PROF=$USER_HOME/.bash_profile
else
PROF=$USER_HOME/.profile
fi;;
zsh)
PROF=$USER_HOME/.zprofile;;
*)
PROF=$USER_HOME/.profile;;
esac
if [ ! -f $PROF ]
then
:>$PROF
chown $1.mail $PROF
elif [ ! "`grep -x \". ~/.trnrc\" $PROF`" ]
then
echo -e "\n. ~/.trnrc" >>$PROF
fi
save $TRNRC
echo "EDITOR=\"$2\"" > $TRNRC
cat copi.trnrc >> $TRNRC
chown $1.mail $TRNRC
}
# Args: user, editor
configure_elm() {
USER=$1
EDIT=$2
dialog --backtitle "$TITLE" --infobox "Configuro elm all'user $USER..." 0 0
USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $USER: | cut -f2 -d:`"
DIRRC="$USER_HOME/.elm"
ELMRC="$DIRRC/elmrc"
mkdir -p $DIRRC -m 700
chown $USER.mail $USERHOME $DIRRC
save $ELMRC
cat <<EOF >$ELMRC
#
# .elm/elmrc - options file for the ELM mail system
#
# Generated by $PKTNAME for $USER
#
# For yes/no settings with ?, ON means yes, OFF means no
# how to sort the alias list, "Name" by default
### aliassortby = Name
# name of editor to use for replies that have text
alteditor = $EDIT
# alternative addresses that I could receive mail from (usually a
# forwarding mailbox) and don't want to have listed...
### alternatives =
# should the default be to delete messages we've marked for deletion?
alwaysdelete = ON
# should the default be to keep unread messages in the incoming mailbox?
alwayskeep = ON
# should the default be to store read messages to the "received" folder?
alwaysstore = OFF
# should we use the "->" rather than the inverse video bar?
arrow = OFF
# should the message disposition questions be displayed(ON) or
# auto-answered(OFF) with the default answers when we resync or
# change folders?
ask = OFF
# would you like to be asked for Carbon-Copies information each msg?
askcc = OFF
# attribution string for replies ('%s' is the author of original message)
attribution = %s wrote:
# automatically copy message being replied to into buffer?
autocopy = ON
# threshold for bouncing copies of remote uucp messages...
# zero = disable function.
### bounceback = 0
# This is used to determine if the builtin pager should be used on some
# messages even if you would usually use an external pager program.
# There are two ways of determining whether the builtin pager should be
# used. If you want any message that is shorter than "n" lines to use the
# internal pager, set the parameter to "n". If you want the builtin
# pager to be used if the message is "m" lines shorter than the number of
# lines on your screen set the parameter to be "-m". Setting the
# parameter to zero will result in the message always being sent through
# your external pager.
### builtinlines = -3
# where to save calendar entries
#calendar = /root/calendar
# list of options that can be configured at the "o)ptions" screen
configoptions = ^_cdefsopyv_am_un
# Should elm always ask the user to confirm before it appends
# messages to any existing file?
# This is used for both folders in the user's mail directory
# and ordinary files.
confirmappend = OFF
# Should elm always ask the user to confirm before it creates
# any new files?
# This is used for both folders in the user's mail directory
# and ordinary files.
confirmcreate = OFF
# Should elm ask for confirmation before it appends a message
# to an existing file that is not a folder in the user's Mail
# directory?
# This is used for ordinary files only and does not affect
# folders in the user's mail directory.
confirmfiles = OFF
# Should elm ask for confirmation before it creates a new folder
# in the user's Mail directory?
# This is used only for folders in the user's mail directory and
# does not affect ordinary files.
confirmfolders = OFF
# save a copy of all outbound messages?
copy = ON
# name of editor for ~e command (when editor="builtin")
easyeditor = $EDIT
# what editor to use ("none" means simulate Berkeley Mail)
editor = $EDIT
# the character to use in the builtin editor for entering commands
### escape = ~
# save outbound messages by login name of sender/recipient even if the
# associated folder doesn't already exist?
### forcename = OFF
# do we want to be able to mail out AT&T Mail Forms?
### forms = OFF
# The full user name for outbound mail
### fullname = $PKTNAME User
# should we keep folders from which all messages are deleted?
### keepempty = OFF
# are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
### keypad = OFF
# local ".signature" file to append to appropriate messages...
localsignature = ~/.signature
# where to save my mail to, default directory is "Mail"
maildir = ~/Mail
# should we display the three-line 'mini' menu?
menu = ON
# would you like a copy of a message you send to an alias you are on?
### metoo = OFF
# when using the page commands (+ - <NEXT> <PREV>) change the current
# message pointer...?
### movepage = OFF
# just show the names when expanding aliases?
names = OFF
# when messages are copied into the outbound buffer, don't include headers?
noheader = ON
# program to use for displaying messages ('builtin' is recommended)
### pager = builtin+
# start up by pointing to the first new message received, if possible?
### pointnew = ON
# list of delivery precedences allowed, or empty to allow anything
# precedence may be followed by optional ":priority" specification
### precedences =
# prefix sequence for indenting included message text in outgoing messages...
prefix = _:>_
# how to print a message ('%s' is the filename)
### print = /bin/cat %s | /usr/bin/lpr
# prompt for a command after the external pager exits?
### promptafter = ON
# Value by which message count is incremented while reading a new mailbox.
# Setting this value to a number larger than one will speed up the time it
# takes to read a large mailbox when using a slow terminal.
### readmsginc = 1
# where to save received messages to, default file is "=received"
receivedmail = =received
# remote ".signature" file to append to appropriate messages...
remotesignature = ~/.signature
# emulate the mailx message increment mode (only increment after
# something has been 'done' to a message, either saved or deleted,
# as opposed to simply each time something is touched)?
### resolve = ON
# save messages, incoming and outbound, by login name of sender/recipient?
savename = ON
# where to save copies of outgoing mail to, default file is "=sent"
sentmail = =sent
# The shell to use for shell escapes
shell = /bin/sh
# do we want dashes above signatures? (News 2.11 compatibility and convention)
### sigdashes = ON
# time in seconds which Elm will wait after displaying a transient message
# and before erasing it. Can be 0 or positive integer.
### sleepmsg = 2
# are we running on an HP terminal and want softkeys available too?
# (this implies "keypad=ON" too)
### softkeys = OFF
# how to sort folders, "Reverse Sent" by default
### sortby = Reverse-Sent
# Set the main prompt timeout for resynching...
### timeout = 600
# display message title when displaying pages of message?
titles = ON
# where to place temporary files, default directory is "/tmp"
### tmpdir = /tmp/
# are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
userlevel = 0
# would you like to use termcap/terminfo ti/te entries?
usetite = ON
# name of editor for ~v command (when editor="builtin")
visualeditor = $EDIT
# enable the weedout list to be read?
### weed = ON
# what headers I DON'T want to see, ever.
weedout = "*end-of-user-headers*"
EOF
chmod 600 $ELMRC
chown $USER.mail $ELMRC
}
--- NEW FILE: copi.trnrc ---
TRNINIT="-x -e -X -F\" :> \""
HIDELINE="^X-FTN"
NEWSHEADER="Newsgroups: %(%F=^\$?%C:%F)
Subject: %(%S=^\$?%\"\n\nSubject: \":%S)
%(%R=^\$?:References: %R
)Sender:
Distribution: %(%i=^\$?%\"\nDistribution: \":%D)
Organization: %o
X-Comment-To: %f\n\n"
ATTRIBUTION="%f writes:\n"
YOUSAID="In article %i \n of newsgroup %C you write about \"%s\":\n"
MAILCALL="(New Mail)"
export NEWSHEADER HIDELINE TRNINIT ATTRIBUTION MAILCALL YOUSAID EDITOR
--- NEW FILE: ifpatch ---
--- ifgate/message.c.orig Mon Jul 24 15:17:47 1995
+++ ifgate/message.c Mon Jul 24 15:18:00 1995
@@ -48,12 +48,26 @@
if (!strcasecmp(msg->key,"X-UUCP-From")) return 0;
if (!strcasecmp(msg->key,"X-Body-Start")) return 0;
if (!strncasecmp(msg->key,"X-FTN-",6)) return 0;
- if (!strcasecmp(msg->key,"Path")) return isftnpath(msg->val)?0:1;
+ if (!strcasecmp(msg->key,"Path"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return isftnpath(msg->val)?0:1;
+#endif
+
if (!strcasecmp(msg->key,"Newsgroups")) return newsmode?0:2;
if (!strcasecmp(msg->key,"Xref")) return 0;
if (!strcasecmp(msg->key,"Return-Receipt-To")) return 1;
if (!strcasecmp(msg->key,"Received")) return newsmode?0:2;
- if (!strcasecmp(msg->key,"From")) return ftnorigin?0:2;
+ if (!strcasecmp(msg->key,"From"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return ftnorigin?0:2;
+#endif
+
if (!strcasecmp(msg->key,"To"))
{
if (newsmode) return 0;
@@ -66,7 +80,14 @@
}
if (!strcasecmp(msg->key,"Cc")) return 2;
if (!strcasecmp(msg->key,"Bcc")) return 2;
- if (!strcasecmp(msg->key,"Reply-To")) return 2;
+ if (!strcasecmp(msg->key,"Reply-To"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return 2;
+#endif
+
if (!strcasecmp(msg->key,"Lines")) return 0;
if (!strcasecmp(msg->key,"Date")) return 0;
if (!strcasecmp(msg->key,"Subject"))
@@ -77,8 +98,22 @@
if (!strcasecmp(msg->key,"Organization")) return removeorg?0:1;
if (!strcasecmp(msg->key,"Comment-To")) return 0;
if (!strcasecmp(msg->key,"X-Comment-To")) return 0;
- if (!strcasecmp(msg->key,"Keywords")) return 2;
- if (!strcasecmp(msg->key,"Summary")) return 2;
+ if (!strcasecmp(msg->key,"Keywords"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return 2;
+#endif
+
+ if (!strcasecmp(msg->key,"Summary"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return 2;
+#endif
+
if (!strcasecmp(msg->key,"MIME-Version")) return removemime?0:1;
if (!strcasecmp(msg->key,"Content-Type")) return removemime?0:1;
if (!strcasecmp(msg->key,"Content-Length")) return removemime?0:1;
@@ -86,8 +121,26 @@
if (!strcasecmp(msg->key,"Content-Name")) return 2;
if (!strcasecmp(msg->key,"Content-Description")) return 2;
if (!strcasecmp(msg->key,"Message-ID")) return ftnorigin?0:1;
- if (!strcasecmp(msg->key,"References")) return removeref?0:1;
- if (!strcasecmp(msg->key,"Distribution")) return ftnorigin?0:1;
+ if (!strcasecmp(msg->key,"References"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return removeref?0:1;
+#endif
+
+ if (!strcasecmp(msg->key,"Distribution"))
+
+#ifdef LESS_RFC_KLUDGES
+ return 0;
+#else
+ return ftnorigin?0:1;
+#endif
+
+#ifdef LESS_RFC_KLUDGES
+ if (!strcasecmp(msg->key,"NNTP-Posting-Host")) return 0;
+#endif
+
/*if (!strcasecmp(msg->key,"")) return ;*/
return 1;
}
More information about the dslinux-commit
mailing list