#!/bin/bash
# 本脚本只适用于麒麟v10sp3系统使用
# 给开机启动脚本权限
chmod +x /etc/rc.d/rc.local
# 关闭 Swap 分区
systemctl disable --now kdump
sed -i "s#crashkernel=1024M,high ##g" /boot/grub2/grub.cfg
# 开机卸载 /tmp
echo "umount /tmp" >> /etc/rc.d/rc.local
# 同步阿里云时间
echo "*/5 * * * * root ntpdate ntp2.aliyun.com &>/dev/null" >> /etc/crontab
# 常用软件安装
yum -y install tree wget net-tools unzip vim telnet lsof nmap tcpdump
# 关闭 SELinux
sed -i '/SELINUX=/d' /etc/selinux/config
sed -i '8i SELINUX=disabled' /etc/selinux/config
# 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
# 添加 grep 别名颜色
echo "export PS1='[\[\e[38;5;141;1m\]\u\[\e[38;5;116;1m\]@\[\e[0m\]\[\e[38;5;208;1m\]\H\[\e[0m\]\[\e[38;5;117;1m\] \w\[\e[0m\]]\$ '" >> /etc/profile
echo "alias grep='grep --color=auto'" >> /etc/profile
echo "alias egrep='egrep --color=auto'" >> /etc/profile
source /etc/profile
暂无评论