diff --git a/install-release-dat.sh b/install-dat-release.sh similarity index 83% rename from install-release-dat.sh rename to install-dat-release.sh index 8fefd1b..3ba134c 100644 --- a/install-release-dat.sh +++ b/install-dat-release.sh @@ -1,16 +1,23 @@ #!/bin/bash +# This Bash script to install the latest release of geoip.dat and geosite.dat: + +# https://github.com/v2ray/geoip +# https://github.com/v2ray/domain-list-community + +# Need cURL, please solve it by yourself + V2RAY="/usr/local/lib/v2ray/" DOWNLOAD_LINK_GEOIP="https://github.com/v2ray/geoip/releases/latest/download/geoip.dat" DOWNLOAD_LINK_GEOSITE="https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat" download_geoip() { - curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.new" "$DOWNLOAD_LINK_GEOIP" -# + curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.new" "$DOWNLOAD_LINK_GEOIP" if [ "$?" -ne '0' ]; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi - curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOIP.sha256sum" -# + curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOIP.sha256sum" if [ "$?" -ne '0' ]; then echo 'error: Download failed! Please check your network or try again.' exit 1 @@ -24,12 +31,12 @@ download_geoip() { } download_geosite() { - curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.new" "$DOWNLOAD_LINK_GEOSITE" -# + curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.new" "$DOWNLOAD_LINK_GEOSITE" if [ "$?" -ne '0' ]; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi - curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOSITE.sha256sum" -# + curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOSITE.sha256sum" if [ "$?" -ne '0' ]; then echo 'error: Download failed! Please check your network or try again.' exit 1