由于最近安装系统的需求,先写系统初始化脚本如下,以此来减少工作量,亲测通过,有什么不对的地方,请各位大牛指出,谢谢

#!/bin/bash
if [[ "$(whoami)" != "root" ]]; then
 echo "Please run this script as root." >&2
 exit 1
fi
echo "------- system init ---------"
echo "------- epel -------"
cd /etc/yum.repos.d/
if [ -f CentOS-Base.repo ];then
  mv CentOS-Base.repo{,.bak}
else
  mv rhel-source.repo{,.bak}
fi
curl -I -s http://172.16.4.250|grep "OK" &> /dev/null
if [[ $? -eq 0 ]];then
  wget http://172.16.4.250/base.repo &> /dev/null
  sleep 3
else
  exit 4
fi
echo "------ close firewall and selinux---"
cp /etc/selinux/config /etc/selinux/config.bak
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
/etc/init.d/iptables stop &> /dev/null
chkconfig iptables off
sleep 3
echo "------- ntp ---------"
echo "20 * * * * /usr/sbin/ntpdate 172.16.0.213 &> /dev/null" >> /var/spool/cron/root
/usr/sbin/ntpdate 172.16.0.213 &> /dev/null
/etc/init.d/crond restart &> /dev/null
sleep 3
read -p 'PLZ input a name:' name
sed -i 's/HOSTNAME=localhost/HOSTNAME=$name/' /etc/sysconfig/network
/bin/hostname $name
echo "-----limits-----"
cat >> /etc/security/limits.conf << EOF
* soft nofile 65535
* hard nofile 65535
EOF
ulimit -HSn 65535
echo "-----sysctl(system kernel)--------"
/bin/cp /etc/sysctl.conf /etc/sysctl.conf.`date + %F`
cat>>/etc/sysctl.conf< /dev/null
echo "------ init finish ------"

请各位大大指正