您好,登錄后才能下訂單哦!
以下內容是關于云計算學習路線源碼框架筆記內容,下面是關于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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。