码迷,mamicode.com
首页 > Web开发 > 详细

使用shell打印菜单,一键安装Web应用

时间:2018-02-24 15:35:17      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:star   ase   应用   技术分享   .sh   使用   root   blog   serve   

问题描述:

技术分享图片

【解答】

[root@A04-Test-172 scripts]# more menu.sh 
echo "1.[install lamp]"
echo "2.[install lnmp]"
echo "3.[exit]"

read -p "pls input the num you want: " num

case $num in 
   1)
   if [ -f "/server/scripts/lamp.sh" ];
   then
       echo "start installing lamp"
       /server/scripts/lamp.sh
       echo "lamp is installed"
   else
       echo "the script /server/scripts/lamp.sh  is not exist!"
   fi
   exit
;;
   2)
   if [ -f "/server/scripts/lnmp.sh" ];
   then 
      echo "start installing lnmp"
      /server/scri[ts/lamp.sh
      echo "lnmp is installed"
   else
     echo "the script /server/scripts/lnmp.sh is not exist!"
   fi
   exit
;;
   3)
   exit
;;
   *)
   echo "Input error"
   exit
;;
esac

 

使用shell打印菜单,一键安装Web应用

标签:star   ase   应用   技术分享   .sh   使用   root   blog   serve   

原文地址:https://www.cnblogs.com/xialiaoliao0911/p/8465964.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!