首页 > Web开发 > 详细

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

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

问题描述:

技术分享图片

【解答】

[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应用

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!