Update install.sh

pull/216/head
midoks 3 years ago
parent d8047b43fa
commit 24bd8daca0
  1. 23
      plugins/webstats/install.sh

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

Loading…
Cancel
Save