From 50dbde87382e119669419af3603a88887a1d4af5 Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Sat, 3 Dec 2022 18:16:52 +0900 Subject: [PATCH] Update InstallNET.sh --- Linux_reinstall/InstallNET.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Linux_reinstall/InstallNET.sh b/Linux_reinstall/InstallNET.sh index e1720e4..4112546 100644 --- a/Linux_reinstall/InstallNET.sh +++ b/Linux_reinstall/InstallNET.sh @@ -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