mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 21:54:40 +08:00
Update InstallNET.sh
This commit is contained in:
parent
ab6d567faa
commit
50dbde8738
1 changed files with 2 additions and 2 deletions
|
@ -365,11 +365,11 @@ function getDisk(){
|
|||
# $1 is timezone checkfile direction, $2 $3 $4 are api keys.
|
||||
function getUserTimezone(){
|
||||
if [[ "$TimeZone" == "" ]]; then
|
||||
UserIP=`who am i | awk '{print $5}' | sed 's/(//g' | sed 's/)//g'`
|
||||
GuestIP=`who am i | awk '{print $5}' | sed 's/(//g' | sed 's/)//g'`
|
||||
for Count in "$2" "$3" "$4"; do
|
||||
[[ "$TimeZone" == "Asia/Shanghai" ]] && break
|
||||
tmpApi=`echo -n "$Count" | base64 -d`
|
||||
TimeZone=`curl -s "https://api.ipgeolocation.io/timezone?apiKey=$tmpApi&ip=$UserIP" | jq '.timezone' | tr -d '"'`
|
||||
TimeZone=`curl -s "https://api.ipgeolocation.io/timezone?apiKey=$tmpApi&ip=$GuestIP" | jq '.timezone' | tr -d '"'`
|
||||
checkTz=`echo $TimeZone | cut -d'/' -f 1`
|
||||
[[ -n "$checkTz" && "$checkTz" =~ ^[a-zA-Z] ]] && break
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue