使用shell打印菜单,一键安装Web应用
Posted foreverfriends
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用shell打印菜单,一键安装Web应用相关的知识,希望对你有一定的参考价值。
问题描述:
【解答】
[root@A04-Test-172 scripts]# more menu.sh
#!/bin/bash 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应用的主要内容,如果未能解决你的问题,请参考以下文章