/dev/null_function syst">
赞
踩
#!/bin/bash . /etc/init.d/functions disable_selinux(){ sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config action "SElinux已禁用,重新启动后才可生效" } disable_firewall(){ systemctl disable --now firewalld &> /dev/null action "防火墙已禁用" } set_ps1(){ echo "PS1='\[\e[1;35m\][\u@\h \W]\\$\[\e[0m\]'" > /etc/profile.d/reset.sh action "提示符已修改成功,请重新登录生效" } set_eth(){ sed -i.bak '/GRUB_CMDLINE_LINUX=/s#"$# net.ifnames=0"#' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg &> /dev/null action "网络名称已修改成功,请重新启动才能生效" } PS3="请选择相应的编号(1-6):" MENU=" 禁用SELinux 关闭防火墙 修改提示符 修改网卡名称 以上全实现 退出 " select menu 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 "请输入正确的数字" esac done
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。