<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello again,<br>
    <br>
    it seems that I've sent you outdated version of script we use,
    correct one is here:<br>
    <br>
    <pre>post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root@localhost&orgName=SystemsManagementQA&submitted=true"
rpm -q spacewalk-branding | grep -- '-2\.4\.' \
    && post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root@localhost&account_type=create_sat"
wget_command="wget --no-check-certificate"
base_uri=<a class="moz-txt-link-rfc2396E" href="https://$SERVER">"https://$SERVER"</a>

handler=${CFU_handler:-CreateFirstUser}
rpm -q spacewalk-branding | grep -- '-2\.4\.' \
    && handler=${CFU_handler:-CreateFirstUserSubmit}

${wget_command} -O create-admin-user.html \
    --save-cookies cookies.txt --keep-session-cookies \
    ${base_uri}
if grep csrf_token create-admin-user.html; then
    token=`grep csrf_token create-admin-user.html | awk -F'"' '{print $6}'`
    post_data="$post_data&csrf_token=${token}"
fi
${wget_command} -O create-admin-user-response.html \
    --post-data "${post_data}" \
    --load-cookies cookies.txt \
    "${base_uri}/rhn/newlogin/$handler.do"</pre>
    <br>
    Tomas<br>
    <br>
    <div class="moz-cite-prefix">On 08/11/2017 09:36 AM, Tomáš Kašpárek
      wrote:<br>
    </div>
    <blockquote
      cite="mid:5c4b4fe2-022a-4905-5fa1-50ae08efa859@redhat.com"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Hello Larry,<br>
      <br>
      we're using following script which creates post request against
      Spacewalk to create first user<br>
      <br>
post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root@localhost&account_type=create_sat"<br>
      wget_command="wget --no-check-certificate"<br>
      base_uri=<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="https://$SERVER">"https://$SERVER"</a><br>
      <br>
      handler=${CFU_handler:-CreateFirstUserSubmit}<br>
      <br>
      ${wget_command} -O create-admin-user.html \<br>
          --save-cookies cookies.txt --keep-session-cookies \<br>
          ${base_uri}<br>
      if grep csrf_token create-admin-user.html; then<br>
          token=`grep csrf_token create-admin-user.html | awk -F'"'
      '{print $6}'`<br>
          post_data="$post_data&csrf_token=${token}"<br>
      fi<br>
      ${wget_command} -O create-admin-user-response.html \<br>
          --post-data "${post_data}" \<br>
          --load-cookies cookies.txt \<br>
          "${base_uri}/rhn/newlogin/$handler.do"<br>
      <br>
      Tomas<br>
      <br>
      <div class="moz-cite-prefix">On 08/11/2017 01:56 AM, Larry Clegg
        wrote:<br>
      </div>
      <blockquote
        cite="mid:1d48dcf0b4e4a7504a02ac243609e870@mail.gmail.com"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=utf-8">
        <meta name="Generator" content="Microsoft Word 15 (filtered
          medium)">
        <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
        <div class="WordSection1">
          <p class="MsoNormal">Hello Spacewalkers,</p>
          <p class="MsoNormal"> </p>
          <p class="MsoNormal">I have been tasked with creating a script
            to completely install and configure a Spacewalk server. 
            This will be used for auto-deployments in future
            datacenters.</p>
          <p class="MsoNormal"> </p>
          <p class="MsoNormal">I have just about everything scripted and
            working except for one major item:   I cannot figure out a
            way to setup the initial Administrator account and
            password.  Normally these are created the first time you
            visit a newly installed SW web site.   Can anyone point me
            in the right direction for doing the same initial work but
            via command line instead?</p>
          <p class="MsoNormal"><br>
            Thanks,</p>
          <p class="MsoNormal"> </p>
          <p class="MsoNormal"
            style="margin-bottom:6.0pt;background:white"><b><span
                style="color:#1c4482">Larry E. Clegg</span></b><span
style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#222222"></span></p>
          <p class="MsoNormal"> </p>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Spacewalk-list mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/spacewalk-list">https://www.redhat.com/mailman/listinfo/spacewalk-list</a></pre>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>