Use scripts to configure the yum Library

Source: Internet
Author: User

Yum. sh
#! /Bin/bash read-p "Enter the image file path (for example,/root/rhel5u5. iso): "jingxiang read-p", enter a mount point (for example,/iso ): "gzd mount-t iso9660" $ jingxiang "" $ gzd "-o loop &>/dev/null if [$? -Eq 0] then if [-f/etc/yum. repos. d/rehl-debuginfo.repo] then echo "the original configuration file is being renamed, please wait... "sleep 2 mv/etc/yum. repos. d/rhel-debuginfo.repo/etc/yum. repos. rhel-debuginfo.repo.bak else if [-f/etc/yum. repos. d/iso. repo] then echo "iso. repo already exists. You do not need to create it again. Continue... "sleep 2 else echo" is creating iso. repo file. Please wait... "sleep 2 touch/etc/yum. repos. d/iso. repo fi echo "the configuration file is being written. Please wait... "sleep 2 echo" [rhel-server] ">/etc/yum. repos. d/iso. repo echo "name = yum server">/etc/yum. repos. d/iso. repo echo "baseurl = file: // $ gzd/Server">/etc/yum. repos. d/iso. repo echo "enabled = 1">/etc/yum. repos. d/iso. repo echo "gpgcheck = 0">/etc/yum. repos. d/iso. repo echo "deleting cached files. Please wait... "sleep 1 yum clean all &>/dev/null echo" the cache has been cleared and is being tested... "sleep 1 yum list & echo" test successful... "echo" Copyright @ Night really gray _ personal blog: http://www.graynight.org/"sleep 1 fi else echo" Please check whether the input directory is correct, whether the file exists... execute "exit fi" again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.