diff --git a/newset.sh b/newset.sh index 772caff..925c5e7 100644 --- a/newset.sh +++ b/newset.sh @@ -27,7 +27,7 @@ do \mv /etc/yum.repos.d/${i} /etc/yum.repos.d/bak/${DATE} done wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo -wget http://mirrors.aliyun.com/repo/Centos-7.repo -P /etc/yum.repos.d +wget http://mirrors.aliyun.com/repo/Centos-7.repo -P /etc/yum.repos.d/ wget http://mirrors.aliyun.com/repo/epel-7.repo -P /etc/yum.repos.d/ yum clean all yum makecache @@ -37,7 +37,7 @@ TOOL_INSTALL() { echo -e "\033[32m-------------------------------------------- 安装常用工具 --------------------------------------------\033[0m" sleep 1.5 -for TOOL in net-tools lrzsz vim unzip git screen nethogs speedtest-cli lm_sensors +for TOOL in net-tools lrzsz vim unzip git screen nethogs speedtest-cli lm_sensors bzip2 do echo -e "\033[33m安装${TOOL}...\033[0m" sleep 1 @@ -68,9 +68,38 @@ cp -r /etc/selinux/config /etc/selinux/config.bak fi sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config } +PS1(){ +cat>>/etc/profile</dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` +if [ "$USER_IP" = "" ] +then +USER_IP=`hostname` +fi +if [ ! -d /var/log/history ] +then +mkdir -p /var/log/history +chmod 777 /var/log/history +fi +if [ ! -d /var/log/history/${LOGNAME} ] +then +mkdir -p /var/log/history/${LOGNAME} +chmod 300 /var/log/history/${LOGNAME} +fi +export HISTSIZE=4096 +DT=`date "+%Y-%m-%d_%H:%M:%S"` +export HISTFILE="/var/log/history/${LOGNAME}/${USER_IP}-log.$DT" +chmod 600 /var/log/history/${LOGNAME}/*log* 2>/dev/null +######################代码结束####################### +EOF +source /etc/profile +} BASE_INSTALL REPO_REPLACE TOOL_INSTALL FIREWALLD IPTABLES - +PS1