From cf8dab851ffe514db774357edd59a407a5b1ab02 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sat, 11 Jul 2020 18:25:10 +0800 Subject: [PATCH 1/3] Make scripts more compatible and fail fast --- install-dat-release.sh | 4 +++- install-release.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/install-dat-release.sh b/install-dat-release.sh index dbd876c..e489045 100644 --- a/install-dat-release.sh +++ b/install-dat-release.sh @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -euxo pipefail # This Bash script to install the latest release of geoip.dat and geosite.dat: diff --git a/install-release.sh b/install-release.sh index 6c70fd7..8439e01 100644 --- a/install-release.sh +++ b/install-release.sh @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -euxo pipefail # The files installed by the script conform to the Filesystem Hierarchy Standard: # https://wiki.linuxfoundation.org/lsb/fhs From a2bd3852e42122c6ade0389838ca4c334bc54202 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Mon, 13 Jul 2020 00:56:56 +0800 Subject: [PATCH 2/3] Revert "Make scripts more compatible and fail fast" This reverts commit cf8dab851ffe514db774357edd59a407a5b1ab02. This affects the normal operation of the script, and debugging should be done deliberately, not to the user. --- install-dat-release.sh | 4 +--- install-release.sh | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/install-dat-release.sh b/install-dat-release.sh index e489045..dbd876c 100644 --- a/install-dat-release.sh +++ b/install-dat-release.sh @@ -1,6 +1,4 @@ -#!/usr/bin/env bash - -set -euxo pipefail +#!/bin/bash # This Bash script to install the latest release of geoip.dat and geosite.dat: diff --git a/install-release.sh b/install-release.sh index 8439e01..6c70fd7 100644 --- a/install-release.sh +++ b/install-release.sh @@ -1,6 +1,4 @@ -#!/usr/bin/env bash - -set -euxo pipefail +#!/bin/bash # The files installed by the script conform to the Filesystem Hierarchy Standard: # https://wiki.linuxfoundation.org/lsb/fhs From d982eaf35580903a907d39c0eef9d3872d3fc477 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Tue, 14 Jul 2020 09:57:44 +0800 Subject: [PATCH 3/3] feat: It is feasible to not install or update geoip.dat and geosite.dat issue #20 --- install-release.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/install-release.sh b/install-release.sh index 6c70fd7..72988b5 100644 --- a/install-release.sh +++ b/install-release.sh @@ -335,8 +335,11 @@ install_v2ray() { install_file v2ray install_file v2ctl install -d /usr/local/lib/v2ray/ - install_file geoip.dat - install_file geosite.dat + # If the file exists, geoip.dat and geosite.dat will not be installed or updated + if [[ ! -f "/usr/local/lib/v2ray/.undat" ]]; then + install_file geoip.dat + install_file geosite.dat + fi # Install V2Ray configuration file to /usr/local/etc/v2ray/ if [[ ! -d '/usr/local/etc/v2ray/' ]]; then @@ -518,8 +521,11 @@ main() { install_startup_service_file echo 'installed: /usr/local/bin/v2ray' echo 'installed: /usr/local/bin/v2ctl' - echo 'installed: /usr/local/lib/v2ray/geoip.dat' - echo 'installed: /usr/local/lib/v2ray/geosite.dat' + # If the file exists, the content output of installing or updating geoip.dat and geosite.dat will not be displayed + if [[ ! -f "/usr/local/lib/v2ray/.undat" ]]; then + echo 'installed: /usr/local/lib/v2ray/geoip.dat' + echo 'installed: /usr/local/lib/v2ray/geosite.dat' + fi if [[ "$CONFDIR" -eq '1' ]]; then echo 'installed: /usr/local/etc/v2ray/00_log.json' echo 'installed: /usr/local/etc/v2ray/01_api.json'