Skip to content

Commit 7a65163

Browse files
committed
refactor(*.sh): curl silent mode
1 parent 74f3890 commit 7a65163

16 files changed

+32
-32
lines changed

centos_install_ss.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ BASE=`pwd`
1313
OS=`hostnamectl | grep -i system | cut -d: -f2`
1414

1515
V6_PROXY=""
16-
IP=`curl -4 ip.sb`
16+
IP=`curl -sL -4 ip.sb`
1717
if [[ "$?" != "0" ]]; then
18-
IP=`curl -6 ip.sb`
18+
IP=`curl -sL -6 ip.sb`
1919
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
2020
fi
2121

centos_install_ssr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ BLUE="\033[36m" # Info message
1010
PLAIN='\033[0m'
1111

1212
V6_PROXY=""
13-
IP=`curl -4 ip.sb`
13+
IP=`curl -sL -4 ip.sb`
1414
if [[ "$?" != "0" ]]; then
15-
IP=`curl -6 ip.sb`
15+
IP=`curl -sL -6 ip.sb`
1616
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
1717
fi
1818

centos_install_v2ray.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ PLAIN='\033[0m'
1111
OS=`hostnamectl | grep -i system | cut -d: -f2`
1212

1313
V6_PROXY=""
14-
IP=`curl -4 ip.sb`
14+
IP=`curl -sL -4 ip.sb`
1515
if [[ "$?" != "0" ]]; then
16-
IP=`curl -6 ip.sb`
16+
IP=`curl -sL -6 ip.sb`
1717
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
1818
fi
1919

centos_install_v2ray2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ CONFIG_FILE="/etc/v2ray/config.json"
3030
OS=`hostnamectl | grep -i system | cut -d: -f2`
3131

3232
V6_PROXY=""
33-
IP=`curl -4 ip.sb`
33+
IP=`curl -sL -4 ip.sb`
3434
if [[ "$?" != "0" ]]; then
35-
IP=`curl -6 ip.sb`
35+
IP=`curl -sL -6 ip.sb`
3636
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
3737
fi
3838

goV2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ YELLOW="33m" # Warning message
4343
BLUE="36m" # Info message
4444

4545
V6_PROXY=""
46-
res=`curl -4 ip.sb`
46+
res=`curl -sL -4 ip.sb`
4747
if [[ "$?" != "0" ]]; then
4848
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
4949
fi

mtproto.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export MTG_IMAGENAME="${MTG_IMAGENAME:-nineseconds/mtg:stable}"
1717
DOCKER_CMD="$(command -v docker)"
1818
OSNAME=`hostnamectl | grep -i system | cut -d: -f2`
1919

20+
IP=`curl -sL -4 ip.sb`
21+
2022
colorEcho() {
2123
echo -e "${1}${@:2}${PLAIN}"
2224
}
@@ -94,7 +96,6 @@ statusText() {
9496
}
9597

9698
getData() {
97-
IP=`curl -sL -4 ip.sb`
9899
read -p " 请输入MTProto端口[100-65535的一个数字]:" PORT
99100
[[ -z "${PORT}" ]] && {
100101
echo -e " ${RED}请输入MTProto端口!${PLAIN}"
@@ -244,7 +245,6 @@ showInfo() {
244245
return
245246
fi
246247

247-
IP=`curl -sL -4 ip.sb`
248248
SECRET=$(cat "$MTG_SECRET")
249249
set -a
250250
source "$MTG_ENV"

ss.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ OS=`hostnamectl | grep -i system | cut -d: -f2`
1515
CONFIG_FILE="/etc/shadowsocks-libev/config.json"
1616

1717
V6_PROXY=""
18-
IP=`curl -4 ip.sb`
18+
IP=`curl -sL -4 ip.sb`
1919
if [[ "$?" != "0" ]]; then
20-
IP=`curl -6 ip.sb`
20+
IP=`curl -sL -6 ip.sb`
2121
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
2222
fi
2323

ssr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ BLUE="\033[36m" # Info message
1010
PLAIN='\033[0m'
1111

1212
V6_PROXY=""
13-
IP=`curl -4 ip.sb`
13+
IP=`curl -sL -4 ip.sb`
1414
if [[ "$?" != "0" ]]; then
15-
IP=`curl -6 ip.sb`
15+
IP=`curl -sL -6 ip.sb`
1616
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
1717
fi
1818

trojan-go.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ PLAIN='\033[0m'
1212
OS=`hostnamectl | grep -i system | cut -d: -f2`
1313

1414
V6_PROXY=""
15-
IP=`curl -4 ip.sb`
15+
IP=`curl -sL -4 ip.sb`
1616
if [[ "$?" != "0" ]]; then
17-
IP=`curl -6 ip.sb`
17+
IP=`curl -sL -6 ip.sb`
1818
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
1919
fi
2020

trojan.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ PLAIN='\033[0m'
1111
OS=`hostnamectl | grep -i system | cut -d: -f2`
1212

1313
V6_PROXY=""
14-
IP=`curl -4 ip.sb`
14+
IP=`curl -sL -4 ip.sb`
1515
if [[ "$?" != "0" ]]; then
16-
IP=`curl -6 ip.sb`
16+
IP=`curl -sL -6 ip.sb`
1717
V6_PROXY="https://cool-firefly-b19e.hijk.workers.dev/"
1818
fi
1919

@@ -860,4 +860,4 @@ menu() {
860860

861861
checkSystem
862862

863-
menu
863+
menu

0 commit comments

Comments
 (0)