优化逻辑
This commit is contained in:
parent
8f70ddc2ce
commit
3ef5c64c30
11
install.sh
11
install.sh
@ -1,11 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
restart_docker() {
|
||||
# 如果docker容器没有启动, 则退出
|
||||
local running_count=$(docker-compose -f ./docker-compose.yml ps -q | wc -l)
|
||||
if [ "$running_count" -eq 0 ]; then
|
||||
echo "容器未启动, 无需重启"
|
||||
read -p "容器未启动,是否启动容器?(Y/N): " choice
|
||||
case "$choice" in
|
||||
Y|y)
|
||||
;;
|
||||
*)
|
||||
echo "已取消启动"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "正在重启容器..."
|
||||
@ -13,7 +19,6 @@ restart_docker(){
|
||||
docker-compose -f ./docker-compose.yml up -d
|
||||
}
|
||||
|
||||
|
||||
check_config(){
|
||||
local config_dir="./conf"
|
||||
# 如果配置文件不存在或者空白
|
||||
|
||||
Loading…
Reference in New Issue
Block a user