|
|
1.1 ! root 1: #include <stdio.h> ! 2: /* ! 3: * NAME ! 4: * connect, notefile,asgnfile,disconnect ! 5: * ! 6: * SYNOPSIS ! 7: * connect(host,dev) ! 8: * char *host; ! 9: * char *dev; ! 10: * ! 11: * notefile(uname,sfile,msg) ! 12: * char *uname; ! 13: * char *sfile; ! 14: * char *msg; ! 15: * ! 16: * char *asgnfile(host,file) ! 17: * char *host; ! 18: * char *file; ! 19: * ! 20: * disconnect (host, dev); ! 21: * char * host, * dev; ! 22: * ! 23: * DESCRIPTION ! 24: * Installation-supplied exits from bscd ! 25: * connect - installation connect routine ! 26: * notefile - send mail to user if file sent successfully and requested by ! 27: * queue control mail flag ! 28: * asgnfile - try to assign a more meaningful name to received files ! 29: * disconnect - installation disconnect routine ! 30: */ ! 31: ! 32: char sccsid[] = "@(#)install.c 1.3 "; ! 33: /* connect - installation connect routine */ ! 34: extern char lockfile[]; ! 35: ! 36: extern char emsg[]; ! 37: connect(host,dev) ! 38: register char *host; ! 39: register char *dev; ! 40: { ! 41: char garbage[80]; ! 42: ! 43: if (isatty(0)) { ! 44: printf("\nReady to connect to host <%s>.\n Press RETURN to continue, or enter 'q' to quit: ", ! 45: host); ! 46: gets(garbage); ! 47: if (garbage[0] == 'q' || garbage[0] == 'Q') { ! 48: unlink(lockfile); ! 49: strcpy(emsg,"User entered 'q' to quit"); ! 50: return(1); ! 51: } ! 52: } else ! 53: printf("\nbscd: Connecting to host <%s>\n",host); ! 54: return(0); ! 55: } ! 56: ! 57: /* notefile - send mail to user if file sent successfully and requested by ! 58: queue control mail flag */ ! 59: notefile(uname,sfile,msg) ! 60: register char *uname; ! 61: register char *sfile; ! 62: register char *msg; ! 63: { ! 64: char address[20]; /* to whom mail is being sent */ ! 65: FILE *popen(); ! 66: register FILE *mailptr; /* popen's mail process pointer */ ! 67: ! 68: if (uname[0] == '\0') ! 69: return; ! 70: sprintf(address,"mail %s",uname); ! 71: if ((mailptr = popen(address,"w")) == NULL) return(0); ! 72: fputs(msg,mailptr); ! 73: pclose(mailptr); ! 74: } ! 75: ! 76: /* asgnfile - try to assign a more meaningful name to received files */ ! 77: char *asgnfile(host,file) ! 78: register char *host; ! 79: register char *file; ! 80: { return(file); } ! 81: ! 82: /* disconnect - called prior to disconnection */ ! 83: disconnect(hostname, devname) ! 84: register char *hostname, *devname; ! 85: { return; }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.