雲計算學習路線源碼框架筆記:while循環結構

以下內容是關於雲計算學習路線源碼框架筆記內容,下面是關於while循環結構的內容:

while 條件

do

循環體

done

完善系統工具的輸出及可操作性

#!/usr/bin/env bash

#

Author: bavdu

Email: [email protected]

Github: https://github.com/bavdu

Date: 2019//

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章