home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
back2roots/padua
/
padua.7z
/
padua
/
uucp
/
gensys0.11.lha
/
gensys.changesys
< prev
next >
Wrap
Text File
|
1993-12-19
|
2KB
|
87 lines
/* gensys.changesys, (c) Sun, 19 Dec 1993 03:43:49 +0100 by "Kai 'wusel' Siering" <wusel@3jean[.uucp|.hanse.de]> */
/*
* $Header: Death:src/wail/CNews/gensys/RCS/gensys.changesys,v 1.1 1993/12/19 02:49:10 wusel Exp wusel $
* $Log: gensys.changesys,v $
* Revision 1.1 1993/12/19 02:49:10 wusel
* Initial revision
*
* $Id: gensys.changesys,v 1.1 1993/12/19 02:49:10 wusel Exp wusel $
*
*/
HostName = ''
DomainName = ''
NewsMaster = ''
UserName = ''
Organization= ''
TmpFileName = 't:gensys.'pragma('ID')'.tmp'
TargetSite = 'changesys-host'
Passwd = 'changesys-password'
if(open(conf, "uulib:config", r)) then do
do while ~eof(conf)
in=readln(conf)
in2 = Translate(in, ' ', D2C(9))
parse var in2 key cont
select
when upper(key)="NODENAME" then HostName = strip(cont)
when upper(key)="DOMAINNAME" then DomainName = strip(cont)
when upper(key)="NEWSMASTER" then NewsMaster = strip(cont)
when upper(key)="USERNAME" then UserName = strip(cont)
when upper(key)="ORGANIZATION" then Organization = strip(cont)
otherwise nop
end
end
err=close(conf)
end
else do
say 'Configuration file (UUlib:config) not found, aborting.'
exit(20)
end
if NewsMaster = '' then NewsMaster = UserName
if NewsMaster = '' then NewsMaster = 'postmaster'
ThisSite = HostName||DomainName
if(open(out, TmpFileName, 'write')) then do
call writeln(out, 'From: 'NewsMaster'@'ThisSite)
call writeln(out, 'Subject: setsys')
call writeln(out, 'To: changesys@'TargetSite)
call writeln(out, 'Organization: 'Organization)
call writeln(out, '')
call writeln(out, 'system: 'HostName)
call writeln(out, 'passwd: 'Passwd)
call writech(out, 'sysentry: ')
LeftPos=11
SetComma=0
do forever
Line = readln(stdin)
if eof(stdin) then break
if(SetComma=1) then call writech(out, ',')
if(LeftPos+Length(Line)>78) then do
call writeln(out, '\')
LeftPos=1
end
SetComma=1
call writech(out, compress(Line))
LeftPos=LeftPos+Length(Line)
end
call close(out)
address COMMAND 'sendmail <'TmpFileName
address COMMAND 'delete 'TmpFileName' >nil:'
end
else
do
say 'Can''t open 'TmpFileName' for writing ...')
exit(20)
end