您好,登录后才能下订单哦!
以下内容是关于云计算学习路线源码框架笔记内容,下面是关于while循环结构的内容:
while 条件
do
循环体
done
完善系统工具的输出及可操作性
#!/usr/bin/env bash
#
while 1>0
do
cat <<-EOF
+-------------------------------------------------------------------------+
| System_tools V1.0 |
+-------------------------------------------------------------------------+
| a. Stop And Disabled Firewalld. |
| b. Disabled SELinux Secure System. |
| c. Install Apache Service. |
| d. Quit |
+-------------------------------------------------------------------------+
EOF
printf "\e[1;35m Please input your select: \e[0m" && read var
case "$var" in
"a")
systemctl stop firewalld && systemctl disable firewalld
;;
"b")
sed -ri s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
;;
"c")
yum -y install httpd httpd-tools
;;
"d")
exit
;;
*)
printf "请按照上方提供的选项输入!!!\n"
;;
esac
if [ $? -eq 0 ];then
clear
else
printf "\e[1;31m Warning: Your program exist ERROR!!! \e[0m\n"
break
fi
done
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。