Compare commits

..

2 Commits

Author SHA1 Message Date
xiaoz c46f984523 fix bug 9 months ago
xiaoz 700b4a28b2 update 9 months ago
  1. 21
      README.md
  2. 41
      dnmp.sh

21
README.md

@ -2,3 +2,24 @@
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,6 +21,11 @@ fi
# 服务列表 # 服务列表
services=(nginx mysql php74) services=(nginx mysql php74)
# 安装运行环境
install_rumtime(){
apt-get update
apt-get install -y curl wget unzip git
}
# 初始化运行 # 初始化运行
init(){ init(){
@ -188,6 +193,39 @@ 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')
@ -199,6 +237,9 @@ 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