Yum. sh #! /Bin/bashread-p & quot; enter the image file path (for example,/root/rhel5u5. iso): & quot; jingxiangread-p & quot; enter Mount point (e.g.:/iso): & quot; gzdmount-tiso9660 & quot; $ jingxiang & quot; $ gzd & qu 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 @ _ personal blog: http://www.graynight.org/ "Sleep 1 fi else echo" check whether the input directory is correct and whether the file exists... re-execute "exit fi
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