~继续优化代码
~bot_tg.sh施工中
This commit is contained in:
18
scripts/libs/web_data.sh
Normal file
18
scripts/libs/web_data.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
. "$CRASHDIR"/libs/set_proxy.sh
|
||||
#$1:目标地址 $2:json字符串
|
||||
web_data_get() {
|
||||
setproxy
|
||||
if curl --version >/dev/null 2>&1; then
|
||||
curl -ksSl --connect-timeout 3 "$1" 2>/dev/null
|
||||
else
|
||||
wget -Y on -q --timeout=3 -O - "$1"
|
||||
fi
|
||||
}
|
||||
web_data_post() {
|
||||
setproxy
|
||||
if curl --version >/dev/null 2>&1; then
|
||||
curl -ksSl -X POST --connect-timeout 3 "$1" "$2" >/dev/null 2>&1
|
||||
else
|
||||
wget -Y on -q --timeout=3 --header="Content-Type: application/octet-stream" --method=POST --body-file="$2" "$1"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user