#!/bin/sh

LIST_OF_APPS="gcc gcc-c++ zlib-devel bzip2-devel openssl-devel ncurses-devel libpcap-devel readline-devel xz-devel curl-devel perl-devel pcre-devel gettext libaio-devel lsof rsync words.noarch git tcp_wrappers-devel vim libffi-devel man unzip xz perl-DBI ntp sudo screen telnet vim-common"

echo "Enabling openvpn at boot"
chkconfig openvpn on
echo""
echo "Installing spacewalk client"
rpm -Uvh https://copr-be.cloud.fedoraproject.org/results/@spacewalkproject/spacewalk-2.8-client/epel-6-x86_64/00742644-spacewalk-repo/spacewalk-client-repo-2.8-11.el6.noarch.rpm
rpm -Uvh http://spacewalk.medstrat.com/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
yum -y install yum-utils openvpn cronie rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin rhncfg-actions
rhn-actions-control --enable-all
echo ""
echo "Registering spacewalk client"
rhnreg_ks --serverUrl=http://spacewalk.medstrat.com/XMLRPC --activationkey=1-97b292077c8acfef6ca3ef948a2b824a

echo""
echo "Upgrading all packages"
yum -y update


# Joints required packages here
echo ""
echo "Installing joints required packages"
yum -y install $LIST_OF_APPS  

