From 4b71ba8d3949d356afbbddac6542762322063694 Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 26 Jun 2024 21:24:26 +0800 Subject: [PATCH] add system upgrade function --- install.sh | 17 ++++++++++++++--- template/custom_config_beauty.json | 4 ++++ template/custom_config_videoblog.json | 4 ++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 template/custom_config_beauty.json create mode 100644 template/custom_config_videoblog.json diff --git a/install.sh b/install.sh index 81292b7..7a9ba47 100755 --- a/install.sh +++ b/install.sh @@ -22,9 +22,7 @@ theend () { # 获取用户桌面绝对路径 getHomePath () { - cd ~/ - path=`pwd` - cd - + path=`cd ~/ && pwd` echo $path } @@ -170,6 +168,15 @@ dockerStartVideoContainer () { videoblog } +# 升级docker容器里的代码到最新版 +upgradeMacheteInContainers () { + docker exec -it machete_album /var/www/machete/bin/upgrade.sh + docker container cp template/custom_config_beauty.json machete_album:/var/www/machete/runtime/custom_config.json + + docker exec -it machete_vlog /var/www/machete/bin/upgrade.sh + docker container cp template/custom_config_videoblog.json machete_vlog:/var/www/machete/runtime/custom_config.json +} + # 检测域名是否能连接 # 返回值:0 - 不能连接,1 - 可连接 detectDomainCanConnect () { @@ -391,4 +398,8 @@ if [ $containerExist -eq 0 ]; then echo "还可以在浏览器输入:http://${ip}:8182/ 打开" fi +echo "" +echo "升级系统到最新版..." +upgradeMacheteInContainers + theend \ No newline at end of file diff --git a/template/custom_config_beauty.json b/template/custom_config_beauty.json new file mode 100644 index 0000000..38da96b --- /dev/null +++ b/template/custom_config_beauty.json @@ -0,0 +1,4 @@ +{ + "theme": "beauty", + "content_directory": "girls/" +} diff --git a/template/custom_config_videoblog.json b/template/custom_config_videoblog.json new file mode 100644 index 0000000..e380bdf --- /dev/null +++ b/template/custom_config_videoblog.json @@ -0,0 +1,4 @@ +{ + "theme": "videoblog", + "content_directory": "videos/" +}