Install scripts of machete
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.
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# 引入公用方法
|
|
|
|
|
. ./funs.sh
|
|
|
|
|
|
|
|
|
|
detect_domain='git.filesite.io'
|
|
|
|
|
echo "正在检测是否能连接[${detect_domain}],请稍后..."
|
|
|
|
|
detectDomainCanConnect "${detect_domain}"
|
|
|
|
|
connect_res=$?
|
|
|
|
|
if [ $connect_res -eq 0 ]; then
|
|
|
|
|
echo "⚠️⚠️"
|
|
|
|
|
echo "当前网络无法连接[${detect_domain}],请参考下面方法解决"
|
|
|
|
|
nslookup "${detect_domain}"
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "根据上面的dns解析结果,如果看到有多个ip地址,请根据目前ping的结果,来修改容器/etc/hosts配置${detect_domain}走另一个ip"
|
|
|
|
|
ping -c 2 "${detect_domain}"
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "hosts文件dns配置格式为:ip+空格+${detect_domain}"
|
|
|
|
|
echo "示例:104.21.55.95 git.filesite.io"
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "进入容器修改hosts文件的步骤:"
|
|
|
|
|
echo "1. 命令行执行:docker exec -it machete_album /bin/sh"
|
|
|
|
|
echo "2. 在容器里用vi打开/etc/hosts文件,加入域名解析配置:vi /etc/hosts"
|
|
|
|
|
echo "3. 修改并保存hosts文件后按ctrl + d退出容器"
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
read -p "已经完成hosts配置,继续升级代码吗?(Y/N): " confirm
|
|
|
|
|
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then
|
|
|
|
|
docker exec -it machete_album /var/www/machete/bin/upgrade.sh
|
|
|
|
|
|
|
|
|
|
echo "系统已升级到最新版"
|
|
|
|
|
echo ""
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
# ===== 升级machete =====
|
|
|
|
|
docker exec -it machete_album /var/www/machete/bin/upgrade.sh
|
|
|
|
|
|
|
|
|
|
echo "系统已升级到最新版"
|
|
|
|
|
echo ""
|
|
|
|
|
fi
|