脚本
#!/bin/bash
echo “本地yum安装中”
rm -f /etc/yum.repos.d/*
mkdir /media/src
mount /dev/sr0 /media/src/ &> /dev/null
echo “[localyum]” >> /etc/yum.repos.d/localyum.repo
echo “baseurl=file:///media/src/” >> /etc/yum.repos.d/localyum.repo
echo “enabled = 1” >> /etc/yum.repos.d/localyum.repo
echo “gpgcheck = 0” >> /etc/yum.repos.d/localyum.repo
echo “完成”
systemctl stop firewalld
setenforce 0
执行apache安装
sh loca (tab)
yum -y install apr* pcre*
创建user.txt文件中的所有用户,并设置密码为123.com
vim /user.txt
添加:
zhang5
zhang6
zhang7
zhang8
zhang9
zhang10
zhang11
zhang12
zhang13
zhang14
zhang15
zhang16
vim useradd.sh
#!/bin/bash
a=cat /user.txt
for i in $a
do
useradd $i
echo “123.com” | passwd $i --stdin
done
执行 sh useradd.sh
shell简单命令和脚本apache安装yum源
最新推荐文章于 2023-03-19 16:55:42 发布