1 Star 0 Fork 0

dddachui/openeuler-init

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
init.sh 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
dddachui 提交于 2023-07-23 17:23 +08:00 . 重新连接网络和去除motd
#!/bin/bash
# for openeuler init os
# disable NetworkManager change resolve.conf
setenforce 0
# change NetworkManager resolve.conf
sh change-NetworkManager-conf.sh
for connection in $(nmcli connection show | grep -E '^[a-z]' | awk '{print $1}'); do nmcli connection up $connection; done
# sure network ok
read -p "please connect network (y/n) : " answer
if [ ! ${answer} == y ];then
exit
fi
# disable services
sh disable-services.sh
# disable selinux
sh disable-selinux.sh
# deploy chrony
sh deploy-chronyc.sh
# enable rc.local
sh add-Execution-authority.sh
# change limits.conf
sh change-limits.sh
# change sshd to make root login
sh change-sshd-config.sh
# user my alias
if [ -f /etc/profile.d/alias.sh ];then
/usr/bin/cp /etc/profile.d/alias.sh /opt
/usr/bin/cp alias.sh /etc/profile.d/
fi
# set HIST
/usr/bin/cp HIST.sh /etc/profile.d/
/usr/bin/cp read-history /usr/bin/
mkdir -p /var/log/history
chmod +x /usr/bin/read-history
# remove system-info.sh
mv /etc/profile.d/system-info.sh /opt
# update grub
/usr/bin/cp update-grub /usr/bin/
chmod +x /usr/bin/update-grub
# set ps1
echo "os_version=$(grep -o 'openEuler-[0-9]\{2\}\.[0-9]\{2\}-LTS-SP[0-9]' /etc/openEuler-latest) " >> /etc/bashrc
echo 'export PS1="\[\e[31m\][$os_version]\[\e[0m\] \T \[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\] \[\e[36m\]\w\[\e[m\] " '>> /etc/bashrc
# remove motd
sh remove-motd.sh
# install software
sh yum-install-softwares.sh
reboot
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/wangdachui2019/openeuler-init.git
git@gitee.com:wangdachui2019/openeuler-init.git
wangdachui2019
openeuler-init
openeuler-init
master

搜索帮助