NFS sharing process script process


#! / bin / bash
#NFS sharing service
# 2019-8-25
# mount the CD
d -p "Please enter your mount point" dir
echo "is mounted ....."
Mount | grep -q "/ dev / SR0" && umount / dev / SR0
[-d $ dir] || mkdir dir
Mount / dev / dir SR0 $ &> / dev / null
echo "mount successful"
cd /etc/yum.repos.d/
[-d likun] || mkdir likun
mv C * likun
<< EDF CAT> local.repo
[xxx]
name = xxx
baseurl = File: // $ dir
Enabled = 1
gpgcheck = 0
EDF
echo "Clear children"
yum All Clean &> / dev / null
echo "build home party base yum "
yum makecache &> / dev / null
echo" build success "
# Prepare the environment
RPM -q nfs rpccbind &> / dev / null
yum -y install nfs-utills the rpcbind &> / dev / null
echo "installation successful"
# Start Service
/etc/init.d/rpcbind Start
/etc/init.d/nfs Start
echo "successful start"
# Mount establish written
mkdir / the WWW
echo 'the Test'> /www/index.html
CAT << EDF> / etc / Exports
/ the WWW 192.168.100.68 (rw) 192.168.100.66 (RO)
EDF
echo "Configuration successful"
# Restart the service
/etc/init.d/nfs & restart> / dev / null
echo "Successful reload"
# View information
showmount -e 192.168.100.68
# Editor DNCP repeater
#! / Sbin / bash
echo "open relay"
echo "close security mechanisms ..."
systemctl STOP firewalld
iptables -F
setenforce 0
#DHCP service
echo "Build Environment"
echo "the DHCP installation ..."
yum -y install dhcp &> / dev / null
echo "Profiles"
CAT << EOF >> /etc/systemctl.conf
net.ipv4.ip a _forward = 1
EOF
echo "start relay route"
sysctl -p
read -p "DHCP server IP" LAL
echo "open forward"
dhcrelay $ LAL

Guess you like

Origin www.cnblogs.com/123456likun/p/11414630.html