Dennis,<br><br>I posted this last week, but here it is again.  This is the script I run (simplified) on each RHEL version that gets its version number and then subscribes it to the correct Satellite channel using activation keys:<br>
<br><br>Also, fyi I scripted the entire registration process including creation of my ssl cert for my local satellite:<br>
<br><br>(I simplified it to the below for the this thread)<br><br>#!/bin/bash<br><br><br>### Variables  -&gt; Need to be updated for rhel 3 servers ( ) and rhel 4 servers ()<br>RHEL3_VER=`cat /etc/redhat-release | awk &#39;{print $7}&#39;`<br>

RHEL3_Point=`cat /etc/redhat-release | awk &#39;{print $10}&#39; | cut -c 1`<br><br><br>RHEL_VER=$RHEL3_VER$RHEL3_Point<br>ARCH=`uname -a | awk &#39;{ print $12 }&#39;`<br><br>cp /etc/sysconfig/rhn/up2date /etc/sysconfig/rhn/up2date.bk<br>

cp /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT  /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT.bk<br><br>## Remove old <a target="_blank" href="http://rhn.redhat.com/">rhn.redhat.com</a> entry if it exists<br>perl -npe &#39;s/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g&#39; -i /etc/sysconfig/rhn/*<br>

perl -npe &#39;s/<a target="_blank" href="http://xmlrpc.rhn.redhat.com/mysatellite.my.domain/">xmlrpc.rhn.redhat.com/mysatellite.my.domain/</a>&#39; -i /etc/sysconfig/rhn/up2date<br><br>## Insert correct SSL Cert and GPG Key<br>
<br>cat &gt; /tmp/gpg-key-1 &lt;&lt;&#39;EOF&#39;<br>
-----BEGIN PGP PUBLIC KEY BLOCK-----<br>xxxxxxxxxxxxxxxxxxx<br>-----END PGP PUBLIC KEY BLOCK-----<br><br>EOF<br># gpg-key1<br>rpm --import /tmp/gpg-key-1<br><br><br><br>cat &gt; /tmp/ssl-key-1 &lt;&lt;&#39;EOF&#39;<br>Certificate:<br>
xxxxxxxxxxxxxxxxxxxxx<br>
-----END CERTIFICATE-----<br>EOF<br># ssl-key1<br>cat /tmp/ssl-key-1 &gt; /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br><br><br><br>if [ $RHEL_VER = 38 -a $ARCH = i686 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>

                        service rhnsd stop<br>                        chkconfig rhnsd off<br>fi<br><br><br>if [ $RHEL_VER = 45 -a $ARCH = x86_64 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>

                        service rhnsd stop<br>                        chkconfig rhnsd off<br>fi<br><br><br>if [ $RHEL_VER = 46 -a $ARCH = i686 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>

                        service rhnsd stop<br>                        chkconfig rhnsd off<br>fi<br><br><br>if [ $RHEL_VER = 46 -a $ARCH = x86_64 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>

                        service rhnsd stop<br>                        chkconfig rhnsd off<br>fi<br><br>if [ $RHEL_VER = 48 -a $ARCH = i686 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>                        service rhnsd stop<br>

                        chkconfig rhnsd off<br>fi<br><br>if [ $RHEL_VER = 48 -a $ARCH = x86_64 ]<br>then<br>                        rhnreg_ks --activationkey=1-xxx --force<br>                        service rhnsd stop<br>

                        chkconfig rhnsd off<br>fi<br><br>if [ $RHEL_VER = 5.3 -a $ARCH = x86_64 ]<br>then<br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>                        rhnreg_ks --activationkey=1-xxx --force<br>

                        <br>fi<br><br>if [ $RHEL_VER = 5.4 -a $ARCH = x86_64 ]<br>then<br>                        <br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>

                        rhnreg_ks --activationkey=1-xxx --force<br>                        <br>fi<br><br>if [ $RHEL_VER = 5.4 -a $ARCH = i686 ]<br>then<br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>

                        rhnreg_ks --activationkey=1-xxx --force<br>                        <br>fi<br><br>if [ $RHEL_VER = 5.6 -a $ARCH = x86_64 ]<br>then<br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>

                        rhnreg_ks --activationkey=1-xxx --force<br>                        <br>fi<br><br>if [ $RHEL_VER = 5.6 -a $ARCH = i686 ]<br>then<br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>

                        rhnreg_ks --activationkey=1-xxx --force<br>                        <br>fi<br><br>if [ $RHEL_VER = 6 -a $ARCH = x86_64 ]<br>then<br>                        service yum-updatesd stop<br>                        chkconfig yum-updatesd off<br>

                        rhnreg_ks --activationkey=1-xxx --force<br>                        <br>fi<br><br><br><br><div class="gmail_quote">On Mon, Aug 1, 2011 at 11:17 AM, Dennis Ruzeski <span dir="ltr">&lt;<a href="mailto:denniruz@gmail.com">denniruz@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Something like this?<br>
<br>
cat /etc/redhat-release |awk  &#39;/release/ { for (x=1;x&lt;=NF;x++) if<br>
($x~&quot;release&quot;) print $(x+1) }&#39;<br>
<font color="#888888"><br>
--Dennis<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Mon, Aug 1, 2011 at 10:52 AM, Chuck Payne &lt;<a href="mailto:terrorpup@gmail.com">terrorpup@gmail.com</a>&gt; wrote:<br>
&gt; Guys,<br>
&gt;<br>
&gt; I am working on adding servers to my Satellite server, and I like to<br>
&gt; be able to get in with a script and call on the following<br>
&gt;<br>
&gt; /etc/redhat_release<br>
&gt;<br>
&gt; But I only want to get the number, so that I can see if it RHEL 4 or<br>
&gt; 5, I been trying to do with awk, but I am not able to get anything,<br>
&gt; what is the best way to only put numbers?<br>
&gt;<br>
&gt; --<br>
&gt; <a href="tel:%28678%29%20636-9678" value="+16786369678">(678) 636-9678</a><br>
&gt; -----------------------------------------<br>
&gt; Discover it! Enjoy it! Share it! openSUSE Linux.<br>
&gt; -----------------------------------------<br>
&gt; openSUSE -- <a href="http://en.opensuse.org/User:Terrorpup" target="_blank">en.opensuse.org/User:Terrorpup</a><br>
&gt; openSUSE Ambassador/openSUSE Member<br>
&gt; skype,twiiter,identica,friendfeed -- terrorpup<br>
&gt; freenode(irc) --terrorpup/lupinstein<br>
&gt; Register Linux Userid: 155363<br>
&gt;<br>
&gt; Have you tried SUSE Studio? Need to create a Live CD,  an app you want<br>
&gt; to package and distribute , or create your own linux distro. Give SUSE<br>
&gt; Studio a try. <a href="http://www.susestudio.com" target="_blank">www.susestudio.com</a>.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Ale mailing list<br>
&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br>