From 9c49f3c8a71432f3baf554c429ac26ddd8108a0d Mon Sep 17 00:00:00 2001 From: wzj <244142824@qq.com> Date: Thu, 24 Nov 2022 10:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86bzip2=E3=80=81?= =?UTF-8?q?=E5=92=8CPS1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- newset.sh | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) 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