#!/bin/bash
#使用shell中select和case来制作一个安装MySQL,Apache,PHP的脚本
ps3="please you whant install server : "
select i in "mysql" "apache" "php"
do
case $i in
mysql )
echo "wait install mysql server......."
tar -zxvf mysql-5.5.62.tar.gz && cd mysql-5.5.62 ; cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/
;;
apache )
echo "wait install apache server ......"
tar -xzvf httpd-2.4.48.tar.gz && cd httpd-2.4.48 ; ./configure --prefix=/usr/local/apache
;;
php )
echo "wait install php server......"
tar -zxvf php-7.3.28.tar.gz && cd php-7.3.28 ; ./configure --prefix=/usr/local/lnmp/php
;;
* )
echo "please input | mysql | php | apache "
;;
esac
done
使用select+case安装服务
最新推荐文章于 2024-08-22 15:08:14 发布