Update install.sh

This commit is contained in:
Core F 2022-11-08 10:55:58 +08:00 committed by GitHub
parent ab5b6eddf0
commit 90cf54f681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -363,9 +363,18 @@ restart_and_update() {
echo -e "> 重启并更新面板"
cd $NZ_DASHBOARD_PATH
docker compose pull
docker compose down
docker compose up -d
docker compose version
if [[ $? == 0 ]]; then
docker compose pull
docker compose down
docker compose up -d
else
docker-compose pull
docker-compose down
docker-compose up -d
fi
if [[ $? == 0 ]]; then
echo -e "${green}哪吒监控 重启成功${plain}"
echo -e "默认管理面板地址:${yellow}域名:站点访问端口${plain}"
@ -381,7 +390,13 @@ restart_and_update() {
start_dashboard() {
echo -e "> 启动面板"
cd $NZ_DASHBOARD_PATH && docker compose up -d
docker compose version
if [[ $? == 0 ]]; then
cd $NZ_DASHBOARD_PATH && docker compose up -d
else
cd $NZ_DASHBOARD_PATH && docker-compose up -d
fi
if [[ $? == 0 ]]; then
echo -e "${green}哪吒监控 启动成功${plain}"
else
@ -396,7 +411,13 @@ start_dashboard() {
stop_dashboard() {
echo -e "> 停止面板"
cd $NZ_DASHBOARD_PATH && docker compose down
docker compose version
if [[ $? == 0 ]]; then
cd $NZ_DASHBOARD_PATH && docker compose down
else
cd $NZ_DASHBOARD_PATH && docker-compose down
fi
if [[ $? == 0 ]]; then
echo -e "${green}哪吒监控 停止成功${plain}"
else
@ -411,7 +432,12 @@ stop_dashboard() {
show_dashboard_log() {
echo -e "> 获取面板日志"
cd $NZ_DASHBOARD_PATH && docker compose logs -f
docker compose version
if [[ $? == 0 ]]; then
cd $NZ_DASHBOARD_PATH && docker compose logs -f
else
cd $NZ_DASHBOARD_PATH && docker-compose logs -f
fi
if [[ $# == 0 ]]; then
before_show_menu
@ -421,7 +447,13 @@ show_dashboard_log() {
uninstall_dashboard() {
echo -e "> 卸载管理面板"
cd $NZ_DASHBOARD_PATH && docker compose down
docker compose version
if [[ $? == 0 ]]; then
cd $NZ_DASHBOARD_PATH && docker compose down
else
cd $NZ_DASHBOARD_PATH && docker-compose down
fi
rm -rf $NZ_DASHBOARD_PATH
docker rmi -f ghcr.io/naiba/nezha-dashboard > /dev/null 2>&1
docker rmi -f registry.cn-shanghai.aliyuncs.com/naibahq/nezha-dashboard > /dev/null 2>&1