Text 10605, 359 rader
Skriven 2007-09-07 23:17:12 av Gert Koefoed Andersen (2:236/150)
Kommentar till text 10604 av Maurice Kinal (1:261/38.9)
Ärende: This from Fidogate help
===============================
* Reply to message originally in area CarbonArea
Hello Maurice!
Sep 07 18:54 07, Maurice Kinal wrote to Gert Koefoed Andersen:
07 Sep 07 18:54, Maurice Kinal wrote to Gert Koefoed Andersen:
GKA>> ## Who are we sending to?
GKA>> if [ -n "$1" ] ; then
GKA>> LIST="$*"
GKA>> else
GKA>> LIST="rmininet"
GKA>> fi
GKA>> ## Who are we sending to?
GKA>> if [ -n "$1" ] ; then
GKA>> LIST="$*"
GKA>> else
GKA>> LIST="fidogate"
GKA>> fi
GKA>> The list function seem not to like to work is there something wrong
GKA>> by cat and list ??
MK>In neither the above scripts is there a list function but instead an
MK>'if' which are shown above. According to those you have to specify it
MK>on the commandline ($1) or it uses a default list which doesn't seem to
MK>be defined anywhere. Offhand not knowing how you are using these
MK>scripts my best guess is that no list is being loaded and thus no
MK>results. 'cat' looks fine if there is something to 'cat'.
They is used ad called from a main scripts named runpoll.
here is the hole 3 first scripts.
----- runffx begins -----
#!/bin/sh
#
# $Id: runffx.sh,v 4.2 2000/04/11 11:32:43 mj Exp $
#
# Run ffx programs
#
# Usage: rungate
#
LOCK=runffx
# Output to "log-in" log file
FIDOGATE_LOGFILE="%G/log-ffx"
export FIDOGATE_LOGFILE
# Lock it
/usr/lib/fidogate/ftnlock -l $LOCK $$
st=$?
if [ $st -ne 0 ]; then
exit 2
fi
# process news for ffx
/usr/lib64/fidogate/bin/send-ffx gert
# batch ffx
# CUSTOMIZE! ----vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
/usr/lib/fidogate/ftnpack -f 900:900/0 -I %B/out.384/gert
/usr/lib/fidogate/ftnpack -f 2:236/150 -I %B/out/fido
# process inbound ffx files
/usr/lib/fidogate/ffxqt
# Unlock it
/usr/lib/fidogate/ftnlock -u $LOCK
exit 0
----- runffx ends -----
----- rungate begins -----
#!/bin/sh
#
# $Id: rungate.sh,v 4.1 1998/11/08 18:28:01 mj Exp $
#
# Run gateway programs
#
# Usage: rungate
#
LOCK=rungate
# Output to "log-in" log file
#FIDOGATE_LOGFILE="%G/log-gate"
#export FIDOGATE_LOGFILE
# Lock it
/usr/lib/fidogate/ftnlock -l $LOCK $$
st=$?
if [ $st -ne 0 ]; then
exit 2
fi
# Process packets for Internet gateway
/usr/lib/fidogate/ftnin -x %L/ftninpost
# Process packets for FTN gateway
/usr/lib/fidogate/ftn2ftn -A 2:2/900 -B 900:900/2
# Unlock it
/usr/lib/fidogate/ftnlock -u $LOCK
exit 0
----- rungate ends -----
----- send-ffx begins -----
#!/bin/sh
#
# $Id: send-ffx.sh,v 4.2 2000/04/11 11:32:43 mj Exp $
#
# SH script to send batches via FIDOGATE ffx
#
. /usr/lib64/news/lib/innshellvars
PROGNAME=`basename $0`
LOCK=${LOCKS}/LOCK.${PROGNAME}
LOG=${MOST_LOGS}/${PROGNAME}.log
MAXJOBS=200
## 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="rmininet"
fi
## Do the work...
for SITE in ${LIST}; do
## See if any data is ready for host.
BATCHFILE=${SITE}.ffx
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
QUEUEJOBS=${MAXJOBS}
echo "${PROGNAME}: [$$] begin ${SITE}"
time batcher -N ${QUEUEJOBS} -b1000000 \
-p"/usr/lib/fidogate/ffxnews %s" \
${SITE} ${BATCHFILE}
echo "${PROGNAME}: [$$] end ${SITE}"
done
## Remove the lock file.
rm -f ${LOCK}
echo "${PROGNAME}: [$$] end `date`"
----- send-ffx ends -----
----- send-fidogate begins -----
#!/bin/sh
#
# $Id: send-fidogate.sh,v 4.5 2004/08/22 08:59:01 n0ll Exp $
#
# SH script to send batches to FIDOGATE
#
# Uncomment to use optimized rfc2ftn -f version
#OPTIMIZE=yes
# Output to "log-news" log file
FIDOGATE_LOGFILE="%G/log-news"
export FIDOGATE_LOGFILE
. /usr/lib64/news/lib/innshellvars
RFC2FTN="/usr/lib64/fidogate/rfc2ftn"
PROGNAME=`basename $0`
LOCK=${LOCKS}/LOCK.${PROGNAME}
LOG=${MOST_LOGS}/${PROGNAME}.log
MAXJOBS=200
## 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="fidogate"
fi
## Do the work...
for SITE in ${LIST}; do
## See if any data is ready for host.
BATCHFILE=${SITE}.fidogate
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
echo "${PROGNAME}: [$$] begin ${SITE}"
INNVERSION="unknown"
if [ "$OPTIMIZE" = "yes" ]; then
INNVERSION="$VERSION"
fi
case "$INNVERSION" in
"INN 2.2"*)
# optimized version for INN 2.2, no longer works with INN 2.3+
time $RFC2FTN -f $BATCHFILE -m 500
;;
"INN 2.4*")
# optimized version for INN 2.4 using sm <vik>
while read a b; do
echo `$NEWSBIN/sm -i $a` $b | sed -e 's/\:\ /\//' >>
$BATCHFILE.fullpath
done < $BATCHFILE 2> /dev/null
rm -f $BATCHFILE
time $RFC2FTN -f $BATCHFILE.fullpath -m 500
;;
*)
# generic version using batcher
time batcher -b500000 -p"$RFC2FTN -b -n" ${SITE} ${BATCHFILE}
;;
esac
echo "${PROGNAME}: [$$] end ${SITE}"
done
## Remove the lock file.
rm -f ${LOCK}
echo "${PROGNAME}: [$$] end `date`"
----- send-fidogate ends -----
The cat and list is maybe dne for the lock but it is more the pack first .pkt
in /fidogate/outpkt and then unpack-pack to real oubound dir.
There is 3 example runpoll fiel 1 for point ad 2 for nodes.
Here is the point runpoll:
----- runpoll begins -----
#!/bin/sh
#
# $Id: runpoll.sh,v 4.15 2000/04/19 17:07:28 mj Exp $
#
# Generic poll script for FIDOGATE points
#
LIBDIR=/usr/lib64/fidogate
BINDIR=/usr/lib64/fidogate/bin
#IFMAIL=/usr/lib64/ifcico
XTERM=/usr/X11R6/bin/xterm
UPLINK=f0.n900.z900
# ^^^^^^ ^^^^^
# configure me!
# -xterm: run in XTerm window
if [ "$1" = "-xterm" ]; then
exec $XTERM -display :0 -g 80x20 -title "FIDOGATE runpoll" -e $0
exit 0
fi
# Show executed commands
set -x
# News gateway (INN)
$BINDIR/send-fidogate
# Tosser w/o file attachments
$BINDIR/runtoss outpkt
$BINDIR/runtoss outpkt/mail
$BINDIR/runtoss outpkt/news
# Poll
#$IFMAIL/ifcico $UPLINK
# Tosser, only protected inbound
$BINDIR/rununpack pin
$BINDIR/runtoss pin
# Gateway
$LIBDIR/ftnin -x %L/ftninpost
# Process tic files
$LIBDIR/ftntick
# Process mail queue (depending on your config, not strictly necessary)
/usr/sbin/sendmail -q
# Tosser expire
$LIBDIR/ftnexpire
----- runpoll ends -----
Some of can be taken out for not send to email server.
GKA>> In fidogate.conf Have I:
MK>I don't see that being used anywhere in either of the scripts.
all smaller scripts is called by mail script for poll to fido system and using
the hole fdogate.conf fles settings + some packing route alias and host files,
is the scripts using to read the config file.
Take care,
Gert
- Get the best in the world with linux -
--- Msged/LNX 6.2.0 (Linux/2.6.19-gentoo-r5 (x86_64))
* Origin: The KofoBBS at http://www.kofobbs.dk (2:236/150)
|