# Time sync
yum install -y rdate
/usr/bin/rdate -s time.bora.net
# yum.repo.d
/usr/bin/yum install -y vim
centos_ver=`/bin/cat /etc/redhat-release | awk '{print substr($3,1,1)}'`
case "$centos_ver" in
6)
/bin/rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
/bin/rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
;;
5)
/bin/rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
/bin/rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
;;
4)
/bin/rpm -Uvh http://dl.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
/bin/rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-4.rpm
;;
esac
# system admin server Key input
mkdir /root/.ssh/
echo "ssh-rsa CCCCB3NzaC1yc2EAAAABIwAAAQEAwPPuh5y7XjgN11k03M+zq7jKL9pAt9bcGZ6axdLdGKUbgrMaL3C5tU6mq5OrClK26vrGfuWrF5jYs7UCE5YEXPhp11JkUthx434vdHHrdsH+iHa/W0Ub7Uajlt40Apc8FIvsNlIt8sJy9jkpT3Bzn+3Xfmtn/9MfyyDsoUqfe9w7tEAzHgYus/WJfNLhpCyiz4jKGL1OHoCwkhWAItRqSyLo4Y7uZPNs2sl9gKu7BOwk9tw3HdFr/UeZbpHEUc1H3c4oJnSicp72PWBDzK+DkI+Ps0ulFo4c5+t1jm+3+N90rmZjihq0tWocF23fqYPyBpANw25qFnAqQ9/fUh+9CQ== root@system-admin" >> /root/.ssh/authorized_keys
# User env
/bin/mv /root/.bashrc /root/bashrc_$TDAY
/usr/bin/wget http://10.0.0.10/system/bashrc_default
/bin/cat /root/src/bashrc_default > /root/.bashrc
source /root/.bashrc
#HOST env
/bin/mv /etc/hosts /etc/hosts.$TDAY
sed "s/$/ $HOSTNAME/" /etc/hosts.$TDAY > /etc/hosts
ifconfig -a | grep "inet " | grep "Bcast:" | awk '{print $2}' | awk -F: '{print $2}' | sed "s/$/ $HOSTNAME/" >> /etc/hosts
# limit.conf
cat << EOF >> "/etc/security/limits.conf"
# Limit nofile config
* soft nofile 65536
* hard nofile 65536
EOF
'IT Study > script' 카테고리의 다른 글
zabbix 3.0 install scripts (0) | 2016.10.10 |
---|---|
linux server default dependencies install (0) | 2016.05.09 |
expect (0) | 2016.05.09 |
file create shell scripts (0) | 2016.03.04 |
mysql schema backup scripts (0) | 2016.02.19 |