Compare commits

..

No commits in common. 'c46f9845238c56cbd6dc8e41914957cc91a779cb' and 'aa22e04f5e5b142e1cd57f362d269e34ae5afc4e' have entirely different histories.

  1. 21
      README.md
  2. 41
      dnmp.sh

21
README.md

@ -2,24 +2,3 @@
Learn more about how DNMP can streamline your development process and make your projects more efficient. Learn more about how DNMP can streamline your development process and make your projects more efficient.
## Install
```bash
git clone https://github.com/helloxz/dnmp.git
cd dnmp
bash dnmp.sh init
# install redis
bash dnmp.sh start redis
# install phpmyadmin
bash dnmp.sh install runtime
bash dnmp.sh install phpmyadmin
```
## Common commands
```bash
# reload nginx config
docker exec -it nginx xc.sh reload
```

41
dnmp.sh

@ -21,11 +21,6 @@ fi
# 服务列表 # 服务列表
services=(nginx mysql php74) services=(nginx mysql php74)
# 安装运行环境
install_rumtime(){
apt-get update
apt-get install -y curl wget unzip git
}
# 初始化运行 # 初始化运行
init(){ init(){
@ -193,39 +188,6 @@ stop(){
fi fi
} }
# 安装服务
install(){
# 获取用户参数
name=$1
# 如果name为空,则提示参数错误
if [ "${name}" = "" ]
then
echo "Usage: $0 install {phpmyadmin}"
exit
fi
# 如果name为phpmyadmin,则安装phpmyadmin,使用case
case $name in
'phpmyadmin')
cd wwwroot/default
wget https://soft.xiaoz.org/php/sourceCode/phpMyAdmin/phpMyAdmin-5.2.1.zip
unzip -o phpMyAdmin-5.2.1.zip
rm -rf phpMyAdmin-5.2.1.zip
# 修改phpmyadmin目录权限
chown -R ${USER}:${USER} ./
;;
'runtime')
install_rumtime
;;
*)
echo "Usage: $0 install {phpmyadmin}"
;;
esac
}
# 通过case判断用户输入的第一个参数,然后执行对应函数的动作 # 通过case判断用户输入的第一个参数,然后执行对应函数的动作
case $1 in case $1 in
'init') 'init')
@ -237,9 +199,6 @@ case $1 in
'stop') 'stop')
stop ${2} stop ${2}
;; ;;
'install')
install ${2}
;;
*) *)
echo "Usage: $0 {init|run|stop}" echo "Usage: $0 {init|run|stop}"
;; ;;

Loading…
Cancel
Save