|
|
Power 6/32 Unix version 1.21
#include <stdio.h>
/*
* NAME
* connect, notefile,asgnfile,disconnect
*
* SYNOPSIS
* connect(host,dev)
* char *host;
* char *dev;
*
* notefile(uname,sfile,msg)
* char *uname;
* char *sfile;
* char *msg;
*
* char *asgnfile(host,file)
* char *host;
* char *file;
*
* disconnect (host, dev);
* char * host, * dev;
*
* DESCRIPTION
* Installation-supplied exits from bscd
* connect - installation connect routine
* notefile - send mail to user if file sent successfully and requested by
* queue control mail flag
* asgnfile - try to assign a more meaningful name to received files
* disconnect - installation disconnect routine
*/
char sccsid[] = "@(#)install.c 1.3 ";
/* connect - installation connect routine */
extern char lockfile[];
extern char emsg[];
connect(host,dev)
register char *host;
register char *dev;
{
char garbage[80];
if (isatty(0)) {
printf("\nReady to connect to host <%s>.\n Press RETURN to continue, or enter 'q' to quit: ",
host);
gets(garbage);
if (garbage[0] == 'q' || garbage[0] == 'Q') {
unlink(lockfile);
strcpy(emsg,"User entered 'q' to quit");
return(1);
}
} else
printf("\nbscd: Connecting to host <%s>\n",host);
return(0);
}
/* notefile - send mail to user if file sent successfully and requested by
queue control mail flag */
notefile(uname,sfile,msg)
register char *uname;
register char *sfile;
register char *msg;
{
char address[20]; /* to whom mail is being sent */
FILE *popen();
register FILE *mailptr; /* popen's mail process pointer */
if (uname[0] == '\0')
return;
sprintf(address,"mail %s",uname);
if ((mailptr = popen(address,"w")) == NULL) return(0);
fputs(msg,mailptr);
pclose(mailptr);
}
/* asgnfile - try to assign a more meaningful name to received files */
char *asgnfile(host,file)
register char *host;
register char *file;
{ return(file); }
/* disconnect - called prior to disconnection */
disconnect(hostname, devname)
register char *hostname, *devname;
{ return; }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.