📄 copi.ifpoll2
字号:
# Packets backup directory - You have to CREATE this directoryBAK=/var/spool/ifmail/BAK# logfile of ifcicoIFLOG=/var/log/ifmail/sysiflog# log archiveIFLOGARC=/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 secondsDELAY=10# where to log processing - file or tty/consoleINFO_TTY=/dev/console# Lets backup the log and use a new oneif [ -e $IFLOG ]; then echo Rearranging logs... cat $IFLOG >> $IFLOGARC cp /dev/null $IFLOGfiecho "`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 2fi# 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 fifi# let's pack the fido stuff..#$FIDOPATH/ifpack# loop until ifcico could connect the node or MaxTry is encountered#i=1; errlv=1while 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 fidone# 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/nullfiecho "`date \"+%b %d %T\"` ifpoll[$$]: finished (rc $errlv)" # >> $INFO_TTY# Collect some infos...echo ""echo "*** Outgoing File Transfer Stats: ***"grep sent $IFLOGecho "*** Incoming File Transfer Stats: ***"grep received $IFLOGecho ""echo "---->> New mail: <<-----"grep echomail $IFLOGecho "---->> Personal mail: <<-----"grep "mail from" $IFLOGecho ""# return the errorlevel of ifcicoexit $errlv
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -