Update install.sh

This commit is contained in:
midoks 2022-10-22 22:57:04 +08:00
parent d8047b43fa
commit 24bd8daca0
1 changed files with 14 additions and 9 deletions

View File

@ -24,6 +24,10 @@ if [ -f ${rootPath}/bin/activate ];then
source ${rootPath}/bin/activate
fi
get_latest_release() {
curl -sL "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | cut -d'"' -f4
}
Install_App()
{
echo '正在安装脚本文件...' > $install_tmp
@ -86,18 +90,19 @@ Install_App()
# https://github.com/P3TERX/GeoLite.mmdb
pip install geoip2
if [ ! -f $serverPath/webstats/GeoLite2-City.mmdb ];then
wget --no-check-certificate -O $serverPath/webstats/GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/releases/download/2022.10.16/GeoLite2-City.mmdb
fi
# if [ ! -f $serverPath/webstats/GeoLite2-City.mmdb ];then
# wget --no-check-certificate -O $serverPath/webstats/GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/releases/download/2022.10.16/GeoLite2-City.mmdb
# fi
# 缓存数据
# if [ ! -f $serverPath/source/webstats/GeoLite2-City.mmdb ];then
# wget --no-check-certificate -O $serverPath/source/webstats/GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/releases/download/2022.10.16/GeoLite2-City.mmdb
# fi
GEO_VERSION=$(get_latest_release "P3TERX/GeoLite.mmdb")
if [ ! -f $serverPath/source/webstats/GeoLite2-City.mmdb ];then
wget --no-check-certificate -O $serverPath/source/webstats/GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/releases/download/${GEO_VERSION}/GeoLite2-City.mmdb
fi
# if [ -f $serverPath/source/webstats/GeoLite2-City.mmdb ];then
# cp -rf $serverPath/source/webstats/GeoLite2-City.mmdb $serverPath/webstats/GeoLite2-City.mmdb
# fi
if [ -f $serverPath/source/webstats/GeoLite2-City.mmdb ];then
cp -rf $serverPath/source/webstats/GeoLite2-City.mmdb $serverPath/webstats/GeoLite2-City.mmdb
fi
echo "${VERSION}" > $serverPath/webstats/version.pl
echo '安装完成' > $install_tmp