You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.5 KiB
83 lines
1.5 KiB
#!/bin/sh |
|
|
|
# 使用说明,用来提示输入参数 |
|
usage() { |
|
echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm|stopbase|rmbase]" |
|
exit 1 |
|
} |
|
|
|
# 开启所需端口 |
|
port(){ |
|
# firewall-cmd --add-port=80/tcp --permanent |
|
# firewall-cmd --add-port=8080/tcp --permanent |
|
# firewall-cmd --add-port=8848/tcp --permanent |
|
# firewall-cmd --add-port=9848/tcp --permanent |
|
# firewall-cmd --add-port=9849/tcp --permanent |
|
# firewall-cmd --add-port=6379/tcp --permanent |
|
# firewall-cmd --add-port=3306/tcp --permanent |
|
# firewall-cmd --add-port=9100/tcp --permanent |
|
# firewall-cmd --add-port=9200/tcp --permanent |
|
# firewall-cmd --add-port=9201/tcp --permanent |
|
# firewall-cmd --add-port=9202/tcp --permanent |
|
# firewall-cmd --add-port=9203/tcp --permanent |
|
# firewall-cmd --add-port=9300/tcp --permanent |
|
# service firewalld restart |
|
echo "开启所需端口(未实现)" |
|
} |
|
|
|
# 启动基础环境(必须) |
|
base(){ |
|
docker-compose up -d ds-nacos |
|
} |
|
# 停止基础环境 |
|
stopbase(){ |
|
docker-compose rm ds-nacos |
|
} |
|
# 删除基础环境 |
|
rmbase(){ |
|
docker-compose rm ds-nacos |
|
} |
|
|
|
# 启动程序模块(必须) |
|
modules(){ |
|
docker-compose up -d ds-gateway ds-miniapps |
|
} |
|
|
|
# 关闭module环境/模块 |
|
stop(){ |
|
docker-compose stop ds-gateway ds-miniapps |
|
} |
|
|
|
# 删除module环境/模块 |
|
rm(){ |
|
docker-compose rm ds-gateway ds-miniapps |
|
} |
|
|
|
|
|
# 根据输入参数,选择执行对应方法,不输入则执行使用说明 |
|
case "$1" in |
|
"port") |
|
port |
|
;; |
|
"base") |
|
base |
|
;; |
|
"modules") |
|
modules |
|
;; |
|
"stop") |
|
stop |
|
;; |
|
"rm") |
|
rm |
|
;; |
|
"stopbase") |
|
stopbase |
|
;; |
|
"rmbase") |
|
rmbase |
|
;; |
|
*) |
|
usage |
|
;; |
|
esac
|
|
|