当前位置:网站首页>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
边栏推荐
- 【无标题】
- xshell评估期已过怎么办
- Day-24 UDP, regular expression
- Session
- mysql怎么创建,删除,查看索引?
- Sequoia China completed the new phase of $9billion fund raising
- 达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑
- Leetcode brush questions: binary tree 19 (merge binary tree)
- Enterprise custom form engine solution (XII) -- experience code directory structure
- [爬虫]使用selenium时,躲避脚本检测
猜你喜欢
leetcode刷题:二叉树19(合并二叉树)
关于 appium 启动 app 后闪退的问题 - (已解决)
基于NeRF的三维内容生成
Smart cloud health listed: with a market value of HK $15billion, SIG Jingwei and Jingxin fund are shareholders
Image pixel read / write operation
Aike AI frontier promotion (7.7)
Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
Adopt a cow to sprint A shares: it plans to raise 1.85 billion yuan, and Xu Xiaobo holds nearly 40%
opencv的四个函数
Sorting, dichotomy
随机推荐
2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
【无标题】
免费手机号码归属地API查询接口
layer弹出层的关闭问题
How does MySQL create, delete, and view indexes?
leetcode刷题:二叉树19(合并二叉树)
visual stdio 2017关于opencv4.1的环境配置
认养一头牛冲刺A股:拟募资18.5亿 徐晓波持股近40%
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
Master公式。(用于计算递归的时间复杂度。)
Users, groups, and permissions
test
处理链中断后如何继续/子链出错removed from scheduling
有什么类方法或是函数可以查看某个项目的Laravel版本的?
用mysql查询某字段是否有索引
图形对象的创建与赋值
2022 examination questions and online simulation examination for safety production management personnel of hazardous chemical production units
Day-16 set
PHP调用纯真IP数据库返回具体地址