当前位置:网站首页>Initialization script
Initialization script
2022-07-07 12:57:00 【LC181119】
Initialization script
#!/bin/bash
#********************************************************************
#Date: 2021-12-15
#FileName: reset.sh
#Description: The test script
#********************************************************************
disable_selinux(){
sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
echo "SElinux Has been disabled , It will not take effect until it is restarted "
}
disable_firewall(){
systemctl disable --now firewalld &> /dev/null
echo " Firewall disabled "
}
set_ps1() {
echo "PS1='\[\e[1;35m\][\[email protected]\h \W]\\$\[\e[0m\]'" > /etc/profile.d/reset.sh
echo " The prompt has been modified successfully , Please login again to take effect "
}
set_eth(){
sed -i.bak '/GRUB_CMDLINE_LINUX=/s#"$# net.ifnames=0"#' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg &> /dev/null
echo " The network name has been modified successfully , Please restart to take effect "
}
PS3=" Please select the corresponding number (1-6): "
MENU='
Ban SELinux
Turn off the firewall
Modify the prompt
Modify the network card name
All the above are realized
sign out
'
select M in $MENU ;do
case $REPLY in
1)
disable_selinux
;;
2)
disable_firewall
;;
3)
set_ps1
;;
4)
set_eth
;;
5)
disable_selinux
disable_firewall
set_ps1
set_eth
;;
6)
break
;;
*)
echo " Please enter the correct number "
;;
esac
done
边栏推荐
- Smart cloud health listed: with a market value of HK $15billion, SIG Jingwei and Jingxin fund are shareholders
- Unity 构建错误:当前上下文中不存在名称“EditorUtility”
- 【从 0 开始学微服务】【02】从单体应用走向服务化
- Importance of database security
- PHP calls the pure IP database to return the specific address
- Layer pop-up layer closing problem
- 事务的七种传播行为
- ISPRS2021/遥感影像云检测:一种地理信息驱动的方法和一种新的大规模遥感云/雪检测数据集
- Leetcode skimming: binary tree 21 (verifying binary search tree)
- test
猜你喜欢
NPM instal reports agent or network problems
[statistical learning method] learning notes - support vector machine (Part 2)
Four functions of opencv
Connect to blog method, overload, recursion
Blog recommendation | Apache pulsar cross regional replication scheme selection practice
Talk about four cluster schemes of redis cache, and their advantages and disadvantages
Smart cloud health listed: with a market value of HK $15billion, SIG Jingwei and Jingxin fund are shareholders
关于 appium 启动 app 后闪退的问题 - (已解决)
Image pixel read / write operation
Lingyunguang of Dachen and Xiaomi investment is listed: the market value is 15.3 billion, and the machine is implanted into the eyes and brain
随机推荐
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
HZOJ #240. Graphic printing IV
2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
Visual stdio 2017 about the environment configuration of opencv4.1
Conversion from non partitioned table to partitioned table and precautions
[learn micro services from 0] [02] move from single application to service
非分区表转换成分区表以及注意事项
[learn microservice from 0] [01] what is microservice
货物摆放问题
. Net ultimate productivity of efcore sub table sub database fully automated migration codefirst
用mysql查询某字段是否有索引
test
File operation command
Day21 multithreading
怎样重置火狐浏览器
Session
[pytorch practice] write poetry with RNN
环境配置篇
图像像素读写操作
Leetcode skimming: binary tree 21 (verifying binary search tree)