Annotation of cci/usr/src/usr.bin/bsc/misc/batch/install.c, revision 1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.