<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2491" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=404431512-17102005><FONT face=Arial 
color=#0000ff size=2>A sample script would be really useful. I'm using an RHN 
Proxy.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=404431512-17102005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rhn-users-bounces@redhat.com 
[mailto:rhn-users-bounces@redhat.com] <B>On Behalf Of </B>Doerbeck, 
Christoph<BR><B>Sent:</B> 17 October 2005 13:12<BR><B>To:</B> Red Hat Network 
Users List<BR><B>Subject:</B> RE: [rhn-users] Preventing Duplicate Registrations 
in RHN<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff size=2>I 
wrote a script to use the RHN api and delete one (or 
many) hosts.  To automate it during a build, I'd recommend a 
web form (which calls the script) and that way you could query using 
wget during the %post from the build client.</FONT></SPAN></DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff size=2>I 
could post a sample of the script if necessary.</FONT></SPAN></DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff size=2>Are 
you using a RHN Satellite or Proxy?</FONT></SPAN></DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff size=2>- 
christoph</FONT></SPAN></DIV>
<DIV><SPAN class=364130712-17102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV></DIV>
<DIV><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> "Dr. 
Günter Schmidt" [mailto:guenter.schmidt@bruker.de] <BR><B>Sent:</B> Monday, 
October 17, 2005 3:31 AM<BR><B>To:</B> Red Hat Network Users 
List<BR><B>Subject:</B> Re: [rhn-users] Preventing Duplicate Registrations in 
RHN<BR><BR></DIV></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">Cornwell, Piers T wrote: 
  <BLOCKQUOTE cite=mid2575D6851C792245BAAF92058766EF197A206A@icex2.ic.ac.uk 
  type="cite">
    <META http-equiv=Context-Type content="text/html; charset=us-ascii">
    <DIV><SPAN>During the %post install section of our install we run rhnreg_ks 
    with the appropriate options to register the system with RHN however when 
    systems are rebuilt, which happens quite often, a new registration gets 
    created (with the same profile name - the machine's hostname - but a 
    different ID). </SPAN></DIV>
    <DIV><SPAN></SPAN> </DIV>
    <DIV><SPAN>Since it's not practical for us to manually delete old 
    profiles, is there any way to write a script to query RHN to see if a 
    profile with this hostname already exists, and if so, to delete it before 
    creating the new registration (or even to force it to use the old system 
    ID)? </SPAN></DIV><PRE wrap="">  </PRE></BLOCKQUOTE>The easiest way is to create a tar file of 
  /etc/sysconfig/rhn and extraxt this file after your system is 
  rebuild.<BR><BR><BR><PRE class=moz-signature cols="72">--
Dr. Günter Schmidt   |   E-Mail: <A class=moz-txt-link-abbreviated href="mailto:gsc@bruker.de">gsc@bruker.de</A>
NMR Software         |   Tel: +49 721 5161 443
Bruker BioSpin GmbH  |   Fax: +49 721 5161 480
</PRE></BLOCKQUOTE></BODY></HTML>