Update install.sh

pull/139/head
midoks 3 years ago
parent 070f3924d0
commit c37845ea2f
  1. 30
      plugins/webstats/install.sh

@ -20,6 +20,10 @@ else
BAK='' BAK=''
fi fi
if [ -f ${rootPath}/bin/activate ];then
source ${rootPath}/bin/activate
fi
Install_App() Install_App()
{ {
echo '正在安装脚本文件...' > $install_tmp echo '正在安装脚本文件...' > $install_tmp
@ -60,17 +64,19 @@ Install_App()
PATH=${serverPath}/openresty/luajit:${serverPath}/openresty/luajit/include/luajit-2.1:$PATH PATH=${serverPath}/openresty/luajit:${serverPath}/openresty/luajit/include/luajit-2.1:$PATH
export PATH=$PATH:$serverPath/webstats/luarocks/bin export PATH=$PATH:$serverPath/webstats/luarocks/bin
if [ "${sys_os}" == "Darwin" ];then if [ ! -f $serverPath/webstats/lua/lsqlite3.so ];then
cd $serverPath/source/webstats/lsqlite3_fsl09y if [ "${sys_os}" == "Darwin" ];then
# SQLITE_DIR=/usr/local/Cellar/sqlite/3.36.0 cd $serverPath/source/webstats/lsqlite3_fsl09y
find_cfg=`cat Makefile | grep 'SQLITE_DIR'` # SQLITE_DIR=/usr/local/Cellar/sqlite/3.36.0
if [ "$find_cfg" == "" ];then find_cfg=`cat Makefile | grep 'SQLITE_DIR'`
LIB_SQLITE_DIR=`brew info sqlite | grep /usr/local/Cellar/sqlite | cut -d \ -f 1 | awk 'END {print}'` if [ "$find_cfg" == "" ];then
sed -i $BAK "s#\$(ROCKSPEC)#\$(ROCKSPEC) SQLITE_DIR=${LIB_SQLITE_DIR}#g" Makefile LIB_SQLITE_DIR=`brew info sqlite | grep /usr/local/Cellar/sqlite | cut -d \ -f 1 | awk 'END {print}'`
sed -i $BAK "s#\$(ROCKSPEC)#\$(ROCKSPEC) SQLITE_DIR=${LIB_SQLITE_DIR}#g" Makefile
fi
make
else
cd $serverPath/source/webstats/lsqlite3_fsl09y && make
fi fi
make
else
cd $serverPath/source/webstats/lsqlite3_fsl09y && make
fi fi
# copy to code path # copy to code path
@ -80,9 +86,9 @@ Install_App()
cp -rf ${DEFAULT_DIR}/lsqlite3.so $serverPath/webstats/lua/lsqlite3.so cp -rf ${DEFAULT_DIR}/lsqlite3.so $serverPath/webstats/lua/lsqlite3.so
fi fi
pip install geoip2
if [ ! -f $serverPath/webstats/GeoLite2-City.mmdb ];then if [ ! -f $serverPath/webstats/GeoLite2-City.mmdb ];then
pip install geoip2 # pip install geoip2
wget --no-check-certificate -O $serverPath/webstats/GeoLite2-City.mmdb https://git.io/GeoLite2-City.mmdb wget --no-check-certificate -O $serverPath/webstats/GeoLite2-City.mmdb https://git.io/GeoLite2-City.mmdb
fi fi

Loading…
Cancel
Save