Linux command Daquan detailed

Source: Internet
Author: User

#!/bin/bashif [["$ (whoami)"! = "root"]]; Then echo ">&2 exit 1fiecho"-------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}ficurl -i-s http://172.16.4.250|grep "OK" &>/dev/nullif [[$?-eq 0]];then wget Http://172.16.4.250/base.repo &AMP;&G T /dev/null Sleep 3else exit 4fiecho "------Close firewall and selinux---" cp/etc/selinux/config/etc/selinux/config.baks Ed-i ' s/selinux=enforcing/selinux=disabled/'/etc/selinux/configsetenforce 0/etc/init.d/iptables stop &>/dev /nullchkconfig iptables offsleep 3echo "-------NTP---------" echo "* * * * */usr/sbin/ntpdate 172.16.0.213 &>/d Ev/null ">>/var/spool/cron/root/usr/sbin/ntpdate 172.16.0.213 &>/dev/null/etc/init.d/crond Restart &>/dev/nullsleep 3read-p ' PLZ input a name: ' Namesed-i ' s/hostname=localhost/hostname= $name/'/etc/syscoNfig/network/bin/hostname $nameecho "-----Limits-----" Cat >>/etc/security/limits.conf << eof* Soft Nofile 65535* hard Nofile 65535eofulimit-hsn 65535echo "-----sysctl (System kernel)--------"/bin/cp/etc/sysctl.conf/etc/ sysctl.conf. ' Date +%F ' Cat>>/etc/sysctl.conf<<eofnet.ipv4.tcp_timestamps = 0net.ipv4.tcp_synack_ Retries = 2net.ipv4.tcp_syn_retries = 2net.ipv4.tcp_mem = 94500000 915000000 927000000net.ipv4.tcp_max_orphans = 3276800net.core.wmem_default = 8388608net.core.rmem_default = 8388608net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.tcp_rmem = 4096 87380 16777216net.ipv4.tcp_wmem = 4096 87380 16777216net.core.netdev_max_backlog = 32768net.core.somaxconn = 32768net.ipv4.tcp_syncookies = 1net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_fin_timeout = 1net.ipv4.tcp_keepalive_time = 600net.ipv4.tcp_max_syn_backlog = 65535net.ipv4.ip_local_ Port_range = 1024x768 65535eof/sbin/sysctl-p &>/dev/nullecho "------init Finish------" 


This article from "It Big strong-carlton" blog, reproduced please contact the author!

Linux command Daquan detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.