雲端計算學習路線原始碼框架筆記:while迴圈結構

千鋒雲端計算發表於2019-11-29

以下內容是關於雲端計算學習路線原始碼框架筆記內容,下面是關於while迴圈結構的內容:

雲端計算學習路線原始碼框架筆記:while迴圈結構

while 條件

do

迴圈體

done

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

#!/usr/bin/env bash

#

# Author: bavdu

# Email: bavduer@163.com

# Github:

# 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


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69916964/viewspace-2666282/,如需轉載,請註明出處,否則將追究法律責任。

相關文章