当前位置:网站首页>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
边栏推荐
- 图形对象的创建与赋值
- Several ways to clear floating
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- 【无标题】
- Charles: four ways to modify the input parameters or return results of the interface
- 云检测2020:用于高分辨率遥感图像中云检测的自注意力生成对抗网络Self-Attentive Generative Adversarial Network for Cloud Detection
- 明星企业普渡科技大裁员:曾募资超10亿 腾讯红杉是股东
- How to apply @transactional transaction annotation to perfection?
- Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)
- 2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
猜你喜欢
. Net ultimate productivity of efcore sub table sub database fully automated migration codefirst
leetcode刷题:二叉树19(合并二叉树)
【无标题】
Creation and assignment of graphic objects
Leetcode brush questions: binary tree 19 (merge binary tree)
Cookie
Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)
云检测2020:用于高分辨率遥感图像中云检测的自注意力生成对抗网络Self-Attentive Generative Adversarial Network for Cloud Detection
数据库安全的重要性
Go语言学习笔记-结构体(Struct)
随机推荐
AUTOCAD——大于180度的角度标注、CAD直径符号怎么输入?
2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
【无标题】
.Net下極限生產力之efcore分錶分庫全自動化遷移CodeFirst
[statistical learning methods] learning notes - Chapter 5: Decision Tree
Day-17 connection set
opencv的四个函数
Guangzhou held work safety conference
[pytorch practice] write poetry with RNN
test
[statistical learning method] learning notes - support vector machine (Part 2)
[statistical learning method] learning notes - support vector machine (I)
What kind of methods or functions can you view the laravel version of a project?
Ip2long and long2ip analysis
NPM instal reports agent or network problems
CMU15445 (Fall 2019) 之 Project#2 - Hash Table 详解
Creation and assignment of graphic objects
Smart cloud health listed: with a market value of HK $15billion, SIG Jingwei and Jingxin fund are shareholders
[learn wechat from 0] [00] Course Overview