From f1ce0cb4c09d21483dd24470615aadae0b64a70f Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Wed, 29 Apr 2020 14:09:23 +0800 Subject: [PATCH] feat: Rename and add some comments 1. I originally planned to use Python, and after thinking about it, I still used Bash. 2. The script depends on cURL, but you need to solve it yourself. --- install-release-dat.sh => install-dat-release.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) rename install-release-dat.sh => install-dat-release.sh (83%) 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