home *** CD-ROM | disk | FTP | other *** search
-
- Here you can find all polling servers I currently know about. Each
- one I have tested, but no one is as good as UUPoll ;_)
-
- ________________________________________________________________________
-
- ProgName Implementation Author(s)
- ________________________________________________________________________
-
- uupoll (C language) William Loftus
- savepoll (C language) Kai Bartels
- uupoll (Rexx language) Rick Morrow and Russell McOrmond
- poll_machine (AmigaDOS batch) Matthew Dillon
- uupoll (AmigaDOS batch) Ralf S. Engelschall and Thomas Lotterer
- poll (Rexx language) Roland Bless
- call (Rexx language) Christian Balzer
- ________________________________________________________________________
-
- -- rse 920716
-
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- /*
- * UUPOLL -- call a UUCP connect site
- *
- * $Header: Beta:src/uucp/src/uucico/RCS/uupoll.c,v 1.1 90/02/02 11:56:15 dillon Exp Locker: dillon $
- *
- * Usage: UUPOLL <system-name>
- *
- * Copyright 1988 by William Loftus. All rights reserved.
- *
- * ARPA: wpl@prc.unisys.com
- * UUCP: wpl@burdvax.UUCP
- * USMAIL: Unisys/Paoli Research Center;PO BOX 517;Paoli, PA 19301-0517
- *
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "version.h"
- #include "protos.h"
-
- #define LOCK_FILE "t:UUCP.LCK"
-
- #define TRUE 1
- #define FALSE 0
-
- IDENT(".04");
-
- CXBRK()
- {
- return(0);
- }
-
- main (argc, argv)
- int argc;
- char ** argv;
- {
- static char buf[256];
-
- if (argc != 2) {
- printf("Usage: UUPOLL <system-name>\n");
- exit(1);
- }
-
- if (access(LOCK_FILE,0) != -1) {
- printf("UUCP is locked.\n");
- exit(0);
- }
-
- if (is_in_L_sys_file(argv[1])) {
- sprintf(buf, "run >nil: <nil: UUCICO -s%s\n", argv[1]);
- if (system(buf) == -1) {
- printf("Error spawning task to call system \"%s\"\n", argv[1]);
- }
- } else {
- printf("System \"%s\" not in L.sys file.\n", argv[1]);
- }
- return(0);
- }
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- /* +---------------------------------------------------------------------+
- | Name: SavePoll.c |
- | Project: none |
- | Version: 1.00 |
- | Author: Kai Bartels |
- | first modified: 900816 |
- | last modified: 900817 |
- +---------------------------------------------------------------------+
- | Description: SavePoll tries to poll a system until it recognises |
- | success. It tries up to n times where n is specified |
- | via the -t<n> switch (default 3). Other switches are: |
- | -m : monitoring - the activities of SavePoll are |
- | reported in a window (default is none), |
- | -d : debugging - (includes -m) additional |
- | information is displayed in that window |
- | (default is none), |
- | -s<n> : delay - SavePoll delayes this amount of secs |
- | before it checks if UUCICO and Uuxqt have |
- | finished their jobs (default is 60). |
- | In addition the system to poll must be specified. |
- | SavePoll requires the comand 'uupoll', 'status' and |
- | 'delete' to reside in the search-path of DOS. |
- +---------------------------------------------------------------------+
- | Functions: log, main |
- +---------------------------------------------------------------------+
- */
-
- #include <exec/types.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <libraries/dosextens.h>
-
- copy #define linesize 80
-
- void log(char *text)
- { struct DateStamp CurrDate;
- BPTR lf;
- char LogLine[160];
-
- DateStamp((long*)&CurrDate);
- sprintf(LogLine,"(----%02d:%02d:%02d) SavePoll - %s\n",
- CurrDate.ds_Minute/60,
- CurrDate.ds_Minute%60,
- CurrDate.ds_Tick/50,
- text);
-
-
- if(lf=Open("uuspool:logfile",MODE_OLDFILE))
- { Seek(lf,0,OFFSET_END);
- Write(lf,LogLine,strlen(LogLine));
- Close(lf);
- }
- }
-
- void main(int argc,char **argv)
- { BPTR monitor=0,lf;
- FILE *fh;
- char *sysname=0,LogLine[120],command[100],line[linesize],*buffer;
- int tries=3,i,j,try,secs=60;
- BOOL mon=FALSE,trying,wait,found,debug=FALSE;
-
- for(i=1;i<argc;i++)
-
- { if(argv[i][0]=='-') /* it's a switch */
- { switch(argv[i][1])
- { case 't': tries=atoi(&argv[i][2]);
- break;
- case 'm': mon=TRUE;
- break;
- case 'd': debug=TRUE;
- mon=TRUE;
- break;
- case 's': secs=atoi(&argv[i][2]);
- break;
- default : sprintf(LogLine,"unknown option '%c' - ignoring",argv[i][1]);
- printf("%s\n",LogLine);
- log(LogLine);
- }
- }
- else /* it's the sysname */
- { if(sysname)
- { sprintf(LogLine,"sorry, I can't poll two systems at once - ignoring '%s'",argv[i]);
- printf("%s\n",LogLine);
- log(LogLine);
- }
- else sysname=argv[i];
- }
- }
-
- log("Startup (900516 kaba)");
-
- if(mon) monitor=Open("con:20/20/600/80/savepoll - monitoring",MODE_NEWFILE);
- if( (!mon) || ((mon)&&(monitor)) )
- { if(sysname)
- { /* here comes the real hot stuff ;-) */
- for(try=0,trying=TRUE;(try<tries)&&(trying);try++)
- { /* pollen */
- if(mon) Write(monitor,"trying to poll ...\n",19);
- sprintf(command,"uupoll %s",sysname);
- Execute(command,0,monitor);
- /* abwarten */
- if(mon) Write(monitor,"starting wait\n",14);
- for(wait=TRUE;wait;)
- { Delay(secs*50); /* 1 minute */
- if(mon) Write(monitor,"delayed 1 min\n",14);
- Execute("Status >ram:savepoll.temp",0,0);
- if(fh=fopen("ram:savepoll.temp","r"))
- { found=FALSE;
- while(fgets(line,linesize,fh))
- { for(i=strlen(line)-1;(i)&&(line[i]!=' ');i--);
- i++;
- if(debug)
- { Write(monitor,"comparing UUCICO & UUXQT to `",29);
- Write(monitor,&line[i],strlen(&line[i])-1);
- Write(monitor,"' - ",2);
- }
- if(!(strcmp("UUCICO\n",&line[i]))) found=TRUE;
- if(!(strcmp("Uuxqt\n",&line[i]))) found=TRUE;
- if(debug)
- { if(found) Write(monitor,"match\n",6);
- else Write(monitor,"no match\n",9);
- }
- }
- fclose(fh);
- if(!found) wait=FALSE;
- }
- else
- { sprintf(LogLine,"internal error 1");
- printf("%s\n",LogLine);
- log(LogLine);
- }
- Execute("delete ram:savepoll.temp",0,0);
- }
- /* logfile pruefen */
- if(mon) Write(monitor,"looking at logfile\n",19);
- /* rueckwaerts nach uucico suchen */
- j=5;
- if(buffer=malloc(2))
- { if(lf=Open("uuspool:logfile",MODE_OLDFILE))
- { Seek(lf,0,OFFSET_END);
- do
- { Read(lf,buffer,1);
- Seek(lf,-2,OFFSET_CURRENT);
- if((*buffer)=="uucico"[j]) j--;
- else j=5;
- }
- while(j>-1);
- free(buffer);
- if(debug) Write(monitor,"uucico found in logfile\n",24);
- if(buffer=malloc(100))
- { Read(lf,buffer,100);
- if(debug)
- { Write(monitor,"the line is `",13);
- Write(monitor,buffer,50);
- Write(monitor,"'...\n",5);
- }
- for(i=0,j=0;(i<100)&&(j<24);i++)
- { /* nach "OK Conversation complete" suchen */
- if(buffer[i]=="OK Conversation complete"[j]) j++;
- else j=0;
- if(j==24) trying=FALSE;
- }
- if(debug)
- { Write(monitor,"`OK Conversation complete' ",27);
- if(trying) Write(monitor,"not found\n",10);
- else Write(monitor,"found\n",6);
- }
- for(i=0,j=0;(i<100)&&(j<17);i++)
- { /* nach "SUCCEEDED call to" suchen */
- if(buffer[i]=="SUCCEEDED call to"[j]) j++;
- else j=0;
- if(j==17) trying=FALSE;
- }
- if(debug)
- { Write(monitor,"`SUCCEEDED call to' ",19);
- if(trying) Write(monitor,"not found\n",10);
- else Write(monitor,"found\n",6);
- }
- free(buffer);
- }
- Close(lf);
- }
- }
- }
- }
- else
- { sprintf(LogLine,"you must specify a system to poll!");
- printf("%s\n",LogLine);
- log(LogLine);
- }
- if(monitor)
- { Write(monitor,"OK - exiting\n",13);
- Delay(150);
- Close(monitor);
- }
- }
- log("Exit");
- }
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- /* Original from: rsm@delfax.Amiga.OCunix.On.Ca (Rick Morrow)
- Changed to WELMAT version by: rwm@atronx.OCUnix.On.Ca (Russell McOrmond) */
-
- /* UUPoll.rexx For use with Welmat 0.46+ and AmigaUUCP 1.13+ */
-
- /*
- * This script allows WELMAT to handle the dialing for you rather
- * than requiring that the line be taken down before each call
- *
- */
-
-
- Options RESULTS
- Options failat 100
-
- parse arg callsystem
-
- x=Open('lsys',"UULib:l.sys",'R')
-
- if x=0 then do
- SysopLog "Error reading UULib:l.sys file!!!"
- Exit 1
- end
-
-
- do forever
-
- Line=ReadLn('lsys')
-
- if EOF('lsys') then Leave
-
- if Left(Line,1)='#' then Iterate
-
- Parse var Line System ' ' Times ' ' Device ' ' Baud ' ' Phone ' ' Junk
-
- if callsystem ~= System then Iterate
-
- Address Command 'wctl -call 1:1/1.0 -number' Phone '-nofido -prerun "uucp:c/uucico -o -s' || System '-DEVICE %d -UNIT %u"'
-
- x=Close('lsys')
-
- Exit RC
- end
-
- Exit 1
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- .KEY hostname/A
- .BRA {
- .KET }
-
- setenv retry{hostname} x
-
- echo >uuspool:C.{hostname}DUMMY
-
- lab loop
- uucico -pri -p1 -s{hostname}
- echo >>env:retry{hostname} x NOLINE
- if $retry{hostname} NOT EQ xxxxxxxx
- if EXISTS uuspool:C.{hostname}DUMMY
- wait 20 min
- skip back loop
- endif
- endif
- delete env:retry{hostname}
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- .KEY hostname/A,SHUT/s
- .BRA {
- .KET }
-
- ;# UUCP/UUPOLL
- ;#
- ;# Use this shell script for polling at your hosts. This checks
- ;# for a successful connection and will do ten retries unless the
- ;# called host finishes the transmission sucessful.
- ;#
- ;# If you specify the SHUT option this will imidiately kill the
- ;# current uucp/uucico process. This is useful only when calling
- ;# this script from an cron table because your polling time is over.
- ;#
- ;# Syntax: uupoll hostname [SHUT]
- ;#
-
- if "{SHUT}" eq ""
-
- ;# - - -- ---- ----- try to poll at a host ----- ---- -- - -
-
- ;# remove the temporary files because a cancelling could have happened last time
- delete >null: uuspool:C.{hostname}DUMMY
- delete >null: uuspool:E.{hostname}DUMMY
-
- ;# initialize counting string
- setenv uupoll_retry{hostname} ""
-
- ;# create dummyfile to test if uucico-operation was successful
- echo >uuspool:C.{hostname}DUMMY
-
- ;# start up polling loop
- lab loop
- echo "polling @ host {hostname}..." NOLINE
- ;# try to call host via uucico
- uucp:c/uucico -7 -pri -p1 -s{hostname}
- ;# increase our counter
- echo >>env:uupoll_retry{hostname} x NOLINE
- ;# has uucico called the host successfully?
- if exists uuspool:C.{hostname}DUMMY
- echo "failed."
- ;# has counter reached the maximum, i.e. retry limit reached?
- if $uupoll_retry{hostname} NOT EQ xxxxxxxxxx
- skip back loop
- else
- echo "POLLING STOPPED - RETRY LIMIT REACHED."
- endif
- else
- echo "succeeded."
- endif
-
- ;# reset enviroment variables
- setenv uupoll_retry{hostname} ""
-
- ;# remove our dummyfiles
- delete >null: uuspool:C.{hostname}DUMMY
- delete >null: uuspool:E.{hostname}DUMMY
-
- else
-
- ;# - - -- ---- ----- try to kill a polling process ----- ---- -- - -
-
- if "$uupoll_process" eq ""
- echo "polling @ host {hostname} already terminated."
- else
- status >env:uupoll_process command UUCICO
- echo "terminating UUCP/UUCICO connection process."
- ;# kill uucico process
- break $uupoll_process C
- echo "processing already transmitted data via manually calling UUCP/UUXQT."
- uucp:c/uuxqt
- endif
-
- endif
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- Path: angle!brumuc!gold.sub.org!imutm1.de.intel.com!inews!olivea!uunet!mcsun!Germany.EU.net!ira.uka.de!smurf.sub.org!flatlin!pilhuhn!spirits!rob
- From: rob@spirits.ka.sub.org (Roland Bless)
- Newsgroups: alt.sys.amiga.uucp
- Subject: Re: UUCICO redialer
- Message-ID: <YUL8r*vy1@spirits.ka.sub.org>
- Date: 5 Jun 92 08:09:00 GMT
- References: <bjohnson.02gw@entprise.UUCP>
- Organization: Byteable Software Products, private, Karlsruhe (FRG)
- Lines: 110
- Content-Type: text/plain; charset=ISO-8859-1
- X-Newsreader: Arn V1.00 beta rel1
-
- In article <bjohnson.02gw@entprise.UUCP>, Bruce Johnson writes:
-
- > Does anyone have an arexx/any redialer for UUCICO? Thanks
-
- ------------------------- cut here -------------------------
- /* poll - automatic poll-program to call UUCP hosts
- (C)opyright R.Bless 1991 - Version 0.5 */
-
- PARSE ARG Host options
-
- version="0.5"
- /* Modify this entries accordingly */
- trials=25
- pause="90 secs"
- DefHost="pilhuhn"
- UUCICO_OPTS="-7 -P7" /* set RTS/CTS, Packet-size 2048 */
- sendbatchCALL='sendbatch -c'
- SPOOLBSMTP='SSMTP'
- BSMTPbatch='BSMTP -c'
-
- /************************************/
-
- if Host=="" then Host=DefHost
- if options=="" then options=UUCICO_OPTS
-
- signal ON BREAK_C
- started=TIME()
- SAY Address()
-
- SAY "UUCP-Polling ARexx-script by R.Bless - V" version
- SAY "starting sendbatch..."
- SAY sendbatchCALL host
- sendbatchCALL host
- SAY "sendbatch ready!"
- SAY "BSMTP batching..."
- SPOOLBSMTP host
- BSMTPbatch host
- SAY "BSMTP ready."
- 'changetaskpri 2'
- 'STACK 50000'
-
- do counter=1 until counter>=trials
- SAY "uucico running: uucico" options "-s"||host
- 'uucico' options '-s'||host
- SAY "uucico ended! Call successful ? Let me see..."
- "tail -1 UUSPOOL:LOGFILE | checkpoll"
- if RC==0 then leave
- if counter>=trials then CALL PollDaemon
- SAY "uucico failed!?"
- SAY "Pausing..."
- 'wait' pause
- SAY "Calling again. Trial #" counter+1 "..."
- end
- SAY "yes, it was!"
- 'stack 16384'
- exit 0
-
- PROCEDURE PollDaemon:
-
- SAY "creating daemon mail..."
- now=TIME()
- 'copy UUCP:c/polldaemon.head T:polldaemon.msg'
- result= Open('file',"T:polldaemon.msg",'A')
- if ~result then exit 5;
- else
- do
- result=writeln('file',"I have been unable to contact" host "since this job was queued.")
- result=writeln('file',"This job started:" started "and ended:" now)
- result=writeln('file',"I gave up after" counter "trials.")
- result=writeln('file', "Please check it out and try again! Thanks.")
- result=Close('file')
- 'type T:polldaemon.msg | sendmail'
- 'wait 5 secs'
- 'delete T:polldaemon.msg'
- end
- return
- ------------------------- cut here -------------------------
- checkpoll:
- ------------------------- cut here -------------------------
- /* checkpoll - searches for successful keywords and returns 1 if failed */
- PARSE PULL line
-
- if Index(line,"FAILED")==0 then exit 0 /* not found */
- else exit 1
- ------------------------- cut here -------------------------
- polldaemon.head:
- ------------------------- cut here -------------------------
- From: poll-daemon@spirits.ka.sub.org (POLL-DAEMON)
- To: root
- Subject: Poll-job failed!
-
- This is an automatic message from the Poll-Daemon.
- ------------------------- cut here -------------------------
-
- To use the pipes you should get Andy Finkels 2.04-Hacks or use WShell.
- If you use Andy's "pipe" you can 'set _pchar |' (only _one_ underscore!)
- and the AmigaShell understands "dir | less" etc...
- Naturally you can use any other method to check for a failed call, like
- using the return-code from uucico.
-
- If the program has reached the maximum number of retries, it'll send
- you a mail.
-
- Regards,
- Roland
- --
- R o l a n d B l e s s |UUCP/USENET: rob@spirits.ka.sub.org |
- Kriegsstrasse 129 |BITNET: UKG5@DKAUNI2.BITNET FAX: +49211623818 |
- 7500 Karlsruhe - FRG |---------spirits--in--the--material--world---------|
- voice +49 721 857328 |"Too much information is driving me insane"(police)|
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-
- /* Call.rexx by <CB>
- * Poll a system and keep on trying for while.
- * Specific for "my" setup, read CNews and AmigaUUCP 1.15D.
-
- Syntax: [rx] Call site [userargs]
-
- // <CB> aka Christian Balzer, P.O. Box 1348, D-6108 Weiterstadt, Germany
- \X/ -The Software Brewery- Domain: CB@frambo.enet.dec.com | CB@brewhq.swb.de
- */
-
- Date = '14-Mar-1992'
- Version = '2.5'
-
- /* You probably want to fidle with the next to definitions */
-
- NumOfRetries = 5 /* number of retries to reach site */
- Timeout = 2*50*60 /* wait 2 minutes before retrying */
-
-
- lockfile = "t:UUXQT.LOCK"
- retc=0
-
- say 'Call.rexx by <CB>/<HR>' Date ' V' Version
- say 'Started at: 'time()
-
- /* open the Rexx support library */
-
- if ~show("L","rexxsupport.library") then do
- if addlib("rexxsupport.library",0,-30,0) then do
- say "Added rexxsupport.library"
- end
- else do
- say "Support library (LIBS:rexxsupport.library) not available."
- say "Aborting..."
- exit 30
- end
- end
-
- dev="serial.device"
- if (open(envf,"env:UUDev",r)) then do
- dev=readln(envf)
- err=close(envf)
- end
-
- unit="0"
- if (open(envf,"env:UUUnit",r)) then do
- unit=readln(envf)
- err=close(envf)
- end
-
- parse arg node uargs
-
- if node="" then do
- say 'No Nodename given, exiting...'
- exit 10
- end
-
- if length(node)<3 then node="brew"||node
-
- 'sendbatches' node
-
- if index(uargs,"-r")=0 then do
- "echo >uuspool:C."node"DUMMY"
- "dir >nil: uuspool:" /* Cache the spool directory */
- end
- else do
- if index(showdir("uuspool:"),node)~=0 then do /* Also caches the spool directory */
- "echo >uuspool:C."node"DUMMY"
- end
- end
-
- Retries = 1
-
- /* Change the uucico line to your requirements */
-
- /* uucmd='uucico -t2 -pri 'uargs' -s'node '-D 'dev '-U 'unit */
-
- uucmd='uucico -7 -pri -t10 'uargs' -s'node '-D 'dev '-U 'unit
-
- say "Trying to reach "node" at "time()
- "sound sounds:ping quiet"
- 'say "Trying to call system 'node'." '
-
- uucmd
-
- do while (exists("uuspool:C."node"DUMMY") & Retries <= NumOfRetries)
- call delay(Timeout)
- say Retries". retry to reach "node" at "time()
- "sound sounds:ping quiet"
- 'say "Trying to call system 'node'." '
- uucmd
- Retries = Retries + 1
- end
- if exists("uuspool:C."node"DUMMY") then do
- "delete uuspool:C."node"DUMMY"
- say "ERROR: Call to "node" failed after "NumOfRetries + 1" retries."
- "sound sounds:brum quiet"
- 'say "Call failed to system 'node'." '
- retc=5
- end
- else do
- call delay(150)
- do while exists(lockfile)
- say "UUxqt still busy..."
- call delay(300) /* Wait 6 seconds */
- end
- 'unbatch'
- 'arnmaster -P-2'
- end
-
- say 'Call.rexx terminated at: 'time()
-
- exit retc
-
- o /
- -----X--------------------------------------------please-cut-here---------
- O \
-