if [ -x /usr/bin/curl ] ; then
output=`/usr/bin/curl -k 2>&1`
error=`echo $output | grep "is unknown"`
if [ -z "$error" ] ; then
FETCH="/usr/bin/curl -SksO"
else
FETCH="/usr/bin/curl -SsO"
fi
fi
fi
HTTP_PUB_DIRECTORY=http://${HOSTNAME}/pub
HTTPS_PUB_DIRECTORY=https://${HOSTNAME}/pub
if [ $USING_SSL -eq 0 ] ; then
HTTPS_PUB_DIRECTORY=${HTTP_PUB_DIRECTORY}
fi
echo
echo "UPDATING RHN_REGISTER/UP2DATE CONFIGURATION FILES"
echo "-------------------------------------------------"
echo "* downloading necessary files"
echo " client_config_update.py..."
rm -f client_config_update.py
$FETCH ${HTTPS_PUB_DIRECTORY}/bootstrap/client_config_update.py
echo " ${CLIENT_OVERRIDES}..."
rm -f $ {CLIENT_OVERRIDES}
$FETCH ${HTTPS_PUB_DIRECTORY}/bootstrap/${CLIENT_OVERRIDES}
if [ ! -f "client_config_update.py" ] ; then
echo "ERROR: client_config_update.py was not downloaded"
exit 1
fi
if [ ! -f "$ {CLIENT_OVERRIDES}" ] ; then
echo "ERROR: $ {CLIENT_OVERRIDES} was not downloaded"
exit 1
fi
echo "* running the update scripts"
if [ -f "/etc/sysconfig/rhn/rhn_register" ] ; then
echo " . rhn_register config file"
/usr/bin/python -u client_config_update.py /etc/sysconfig/rhn/rhn_register \
${CLIENT_OVERRIDES}
fi
echo " . up2date config file"
/usr/bin/python -u client_config_update.py /etc/sysconfig/rhn/up2date \
$ {CLIENT_OVERRIDES}
if [ ! -z "$ ORG_GPG_KEY" ] ; then
echo
echo "* importing organizational GPG key"
rm -f ${ORG_GPG_KEY}
$FETCH $ {HTTPS_PUB_DIRECTORY}/${ORG_GPG_KEY}
# get the major version of up2date
res=$(rpm -q --queryform at '%{version}' up2date | sed -e 's/\..*//g')
if [ $res -eq 2 ] ; then
gpg $ (up2date --gpg-flags) --import $ORG_GPG_KEY
else
rpm --import $ORG_GPG_KEY
fi
fi
Comentarios a estos manuales