lmgsanm

每天学习一点,每天进步一点点…… Tomorrow is another beatifull day

导航

新机自动创建yum库

#!/bin/bash
#for a newsystem to setup auto reposity

YUM_DIR=/etc/yum.repos.d
MOUNT_DIR=/mnt
DEV_DIR="192.168.0.155:/uc/files/os/CentOS-6.5-x86_64/"
YUM_CONF=/etc/yum.repos.d/yum.repo
mkdir $YUM_DIR/backup
mkdir $MOUNT_DIR/cdrom
mv $YUM_DIR/Cent* $YUM_DIR/backup
touch $YUM_CONF
echo "[yum]" >> $YUM_CONF
echo "name=yum" >> $YUM_CONF
echo "baseurl=file://${MOUNT_DIR}/cdrom" >> $YUM_CONF
echo "enable=1" >> $YUM_CONF
echo "gpgcheck=0" >> $YUM_CONF

#modify selinux setup
mv /etc/selinux/config /etc/selinux/config.bak #backup selinux configure
sed 's/enforcing/disabled/g' /etc/selinux/config.bak > /etc/selinux/config
chkconfig iptables off
service iptables stop
setenforce 0

posted on 2015-12-17 22:25  lmgsanm  阅读(180)  评论(0编辑  收藏  举报