[Ubuntu17.10]Auto setup NFS server

###################################################################
##Auto setup the NFS server under Unbuntu OS                     ##
##Host IP is 172.17.200.229,please modify it base on your system ##
##Please replace the below setting with your password            ##
##"echo "yourpassword" |sudo -S apt-get update"                  ##
##Autor:CAD Daimon Date:2018/01/15                               ##
###################################################################
#!/bin/bash
echo "1" |sudo -S apt-get update
echo "1" |sudo -S apt-get upgrade
echo "1" |sudo -S apt-get install nfs-common
echo "1" |sudo -S apt-get install nfs-kernel-server
echo "1" |sudo -S apt-get install net-tools
echo "1" |sudo -S mkdir /home/nfs
echo "1" |sudo -S chmod 777 /home/nfs -R
echo "1" |sudo -S cp /etc/exports /home/nfs/exports
echo "1" |sudo -S cp /etc/exports /home/nfs/exports_backup
echo "1" |sudo -S chmod 777 /home/nfs/exports
echo "/home/nfs *(rw)" > /home/nfs/exports
echo "1" |sudo -S chmod 644 /home/nfs/exports
echo "1" |sudo -S cp /home/nfs/exports /etc/exports
echo "1" |sudo -S service nfs-kernel-server restart
sleep 3
showmount -e
sleep 3
read -n1 -p "Does the nfs server install successfully?[Y/N]?"
case $REPLY in
Y | y) echo
 echo "Fine ,continue on ..."
 ifconfig -a
 echo "Pease record the server IP and prepare for the next step!"
 showmount -e 172.17.200.229
 echo "1" |sudo -S mount 172.17.200.229:/home/nfs /mnt
 echo "List the nfs folder and the files:"
 sleep 3
 ls -l /mnt/*
 echo "Test done on the HOST,please do tset on the client!"
 ;;
N | n) echo 
 echo "OK, goodbye..."
 ;;
esac